Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Pavel Stehule
so 3. 4. 2021 v 19:45 odesílatel aditya desai napsal: > Yes. I have made suggestions on connection pooling as well. Currently it > is being done from Application side. > It is usual - but the application side pooling doesn't solve well overloading. The behaviour of the database is not linear. Us

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
Yes. I have made suggestions on connection pooling as well. Currently it is being done from Application side. On Sat, Apr 3, 2021 at 11:12 PM Pavel Stehule wrote: > > > so 3. 4. 2021 v 19:37 odesílatel aditya desai napsal: > >> Hi Justin/Bruce/Pavel, >> Thanks for your inputs. After setting for

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Pavel Stehule
so 3. 4. 2021 v 19:37 odesílatel aditya desai napsal: > Hi Justin/Bruce/Pavel, > Thanks for your inputs. After setting force_parallel_mode=off Execution > time of same query was reduced to 1ms from 200 ms. Worked like a charm. We > also increased work_mem to 80=MB. Thanks > super. The too big m

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
Hi Justin/Bruce/Pavel, Thanks for your inputs. After setting force_parallel_mode=off Execution time of same query was reduced to 1ms from 200 ms. Worked like a charm. We also increased work_mem to 80=MB. Thanks again. Regards, Aditya. On Sat, Apr 3, 2021 at 9:14 PM aditya desai wrote: > Thanks

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
Thanks Justin. Will review all parameters and get back to you. On Sat, Apr 3, 2021 at 9:11 PM Justin Pryzby wrote: > On Sat, Apr 03, 2021 at 11:39:19AM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > > >> Yes, force_parallel

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Bruce Momjian
On Sat, Apr 3, 2021 at 10:41:14AM -0500, Justin Pryzby wrote: > On Sat, Apr 03, 2021 at 11:39:19AM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > > >> Yes, force_parallel_mode is on. Should we set it off? > > > > > Yes. I b

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Bruce Momjian
On Sat, Apr 3, 2021 at 11:39:19AM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > >> Yes, force_parallel_mode is on. Should we set it off? > > > Yes. I bet someone set it without reading our docs: > > > > > https://www.pos

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Justin Pryzby
On Sat, Apr 03, 2021 at 11:39:19AM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > >> Yes, force_parallel_mode is on. Should we set it off? > > > Yes. I bet someone set it without reading our docs: > > > > > https://www.pos

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Tom Lane
Bruce Momjian writes: > On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: >> Yes, force_parallel_mode is on. Should we set it off? > Yes. I bet someone set it without reading our docs: > > https://www.postgresql.org/docs/13/runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Bruce Momjian
On Sat, Apr 3, 2021 at 09:00:24PM +0530, aditya desai wrote: > adding the group. Perfect. That is a lot of non-default settings, so I would be concerned there are other misconfigurations in there --- the group here might have some tips. >  aad_log_min_messages                  | warning       

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Pavel Stehule
so 3. 4. 2021 v 17:30 odesílatel aditya desai napsal: > adding the group. > > aad_log_min_messages | warning > | configuration file > application_name | psql >| client > archive_command

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
I will gather all information and get back to you On Sat, Apr 3, 2021 at 9:00 PM Pavel Stehule wrote: > > > so 3. 4. 2021 v 17:15 odesílatel aditya desai napsal: > >> Hi Pavel, >> Thanks for response. Please see below. >> work_mem=16MB >> maintenance_work_mem=1GB >> effective_cache_size=160GB >

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
adding the group. aad_log_min_messages | warning | configuration file application_name | psql | client archive_command | c:\postgres\bin\xlogcopy\xlogcopy.exe archive blob "%f" "%p"

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Bruce Momjian
On Sat, Apr 3, 2021 at 11:12:01AM -0400, Bruce Momjian wrote: > On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > > Hi Justin, > > Yes, force_parallel_mode is on. Should we set it off? > > Yes. I bet someone set it without reading our docs: > > > https://www.postgresql.org/

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
Thanks Bruce!! Will set it off and retry. On Sat, Apr 3, 2021 at 8:42 PM Bruce Momjian wrote: > On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > > Hi Justin, > > Yes, force_parallel_mode is on. Should we set it off? > > Yes. I bet someone set it without reading our docs: > > > ht

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Bruce Momjian
On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > Hi Justin, > Yes, force_parallel_mode is on. Should we set it off? Yes. I bet someone set it without reading our docs: https://www.postgresql.org/docs/13/runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER --> Allows

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
Hi Justin, Yes, force_parallel_mode is on. Should we set it off? Regards, Aditya. On Sat, Apr 3, 2021 at 7:46 PM Justin Pryzby wrote: > On Sat, Apr 03, 2021 at 04:08:01PM +0200, Pavel Stehule wrote: > > so 3. 4. 2021 v 15:38 odesílatel aditya desai > napsal: > > > "Gather (cost=1000.43..1002.7

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Bruce Momjian
On Sat, Apr 3, 2021 at 08:29:22PM +0530, aditya desai wrote: > Hi Michael, > Thanks for your response. > Is this table partitioned? - No > How long ago was migration done? - 27th March 2021 > Has vacuum freeze and analyze of tables been done? - We ran vacuum analyze. >  Was index created after pop

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
Hi Michael, Thanks for your response. Is this table partitioned? - No How long ago was migration done? - 27th March 2021 Has vacuum freeze and analyze of tables been done? - We ran vacuum analyze. Was index created after populating data or reindexed after perhaps? - Index was created after data lo

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Justin Pryzby
On Sat, Apr 03, 2021 at 04:08:01PM +0200, Pavel Stehule wrote: > so 3. 4. 2021 v 15:38 odesílatel aditya desai napsal: > > "Gather (cost=1000.43..1002.75 rows=1 width=127) (actual > > time=174.318..198.539 rows=1 loops=1)" > > " Workers Planned: 1" > > " Workers Launched: 1" > > " Single Copy: tru

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Michael Lewis
It seems like something is missing. Is this table partitioned? How long ago was migration done? Has vacuum freeze and analyze of tables been done? Was index created after populating data or reindexed after perhaps? What version are you using?

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Pavel Stehule
so 3. 4. 2021 v 15:38 odesílatel aditya desai napsal: > Hi, > We migrated our Oracle Databases to PostgreSQL. One of the simple select > query that takes 4 ms on Oracle is taking around 200 ms on PostgreSQL. > Could you please advise. Please find query and query plans below. Gather > cost seems h

Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread Bharath Rupireddy
On Sat, Apr 3, 2021 at 7:08 PM aditya desai wrote: > > Hi, > We migrated our Oracle Databases to PostgreSQL. One of the simple select > query that takes 4 ms on Oracle is taking around 200 ms on PostgreSQL. Could > you please advise. Please find query and query plans below. Gather cost seems >

SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.

2021-04-03 Thread aditya desai
Hi, We migrated our Oracle Databases to PostgreSQL. One of the simple select query that takes 4 ms on Oracle is taking around 200 ms on PostgreSQL. Could you please advise. Please find query and query plans below. Gather cost seems high. Will increasing max_parallel_worker_per_gather help? explain