Re: Postgres performance comparing GCP and AWS

2021-03-01 Thread Hannu Krosing
Have you tried to set the instance running on GCP to have similar shared_buffers as the AWS database ? What you described has a much lower cache hit rate on GCS and 2X the shared buffers on AWS which could well explain much of the difference in execution times. DETAILS: Query explain for Postgres

Re: Potential performance issues

2021-03-01 Thread Hannu Krosing
... * Remove `LIMIT` to prevent any non-deterministic behaviors This seems counterproductive, as for example PostgreSQL has special handling of "fast start" queries which is triggered by presence of LIMIT or OFFSET, so this will miss some optimisations. Also,it is not like removing LIMIT is some

Re: Potential performance issues related to group by and covering index

2021-03-04 Thread Hannu Krosing
In the original example it looks like using the index (and not running a parallel query) is what made the query slow The fast version was brute-force sequscan(s) + sort with 3 parallel backends (leader + 2 workers) sharing the work. On Tue, Mar 2, 2021 at 10:42 PM David Rowley wrote: > > On Wed

Re: SQL performance issue (postgresql chooses a bad plan when a better one is available)

2021-03-22 Thread Hannu Krosing
you can play around various `enable_*` flags to see if disabling any of these will *maybe* yield the plan you were expecting, and then check the costs in EXPLAIN to see if the optimiser also thinks this plan is cheaper. On Mon, Mar 22, 2021 at 6:29 PM Chris Stephens wrote: > > we are but i was h

Re: SQL performance issue (postgresql chooses a bad plan when a better one is available)

2021-03-23 Thread Hannu Krosing
erial=false;" produces an efficient plan. good to know there > are *some* knobs to turn when the optimizer comes up with a bad plan. would > be awesome if you could lock that plan into place w/out altering the variable. > > thanks for the help Hannu! > > On Mon, Mar 22, 20

Re: High-volume writes - what is the max throughput possible

2021-03-30 Thread Hannu Krosing
Are you issuing "tens of reads and tens of updates/ inserts" for your ACID transaction individually from SQL client, or have you packaged them as a single database function ? Using the function can be much faster, as it eliminates all the command latencies between the client and the server. Cheer

Re: PostgreSQL and a Catch-22 Issue related to dead rows

2024-12-10 Thread Hannu Krosing
If there are unremovable rows it usually also means that index-only scan degrades to index-scan-with-visibility-checks-in-tables. I think the ask is to be able to remove the recently dead rows that are not visible in any current snapshot and can never become visible to any future snapshot, Somethi

Re: parallel pg_restore blocks on heavy random read I/O on all children processes

2025-04-09 Thread Hannu Krosing
You may be interested in a patch "Adding pg_dump flag for parallel export to pipes"[1] which allows using pipes in directory former parallel dump and restore. There the offsets are implicitly taken care of by the file system. [1] https://www.postgresql.org/message-id/CAH5HC97p4kkpikar%2BswuC0Lx4Y