RowLock and multiple transactions

2024-02-14 Thread Hannes Erven
Hi, when "SELECT .. WHERE .. FOR NO KEY UPDATE" is used synchronize access, and the transaction holding the lock completes, how does PostgreSQL decide /which one/ of multiple waiting transactions will the lock be granted to next? In my testing (on Ubuntu 16.1-1.pgdg20.04+1, 64bit) with a

Re: postgres large database backup

2022-11-30 Thread Hannes Erven
Am 30.11.22 um 20:01 schrieb Mladen Gogala: On 11/30/22 10:40, Atul Kumar wrote: Hi, I have a 10TB database running on postgres 11 version running on centos 7 "on premises", I need to schedule the backup of this database in a faster way. The scheduled backup will be used for PITR purposes.

Big variance in execution times of simple queries

2022-01-24 Thread Hannes Erven
Hi community, I'm looking at a "SELECT * FROM pg_stat_statements" output and am puzzled by the huge differences between min/max_exec_time even for simple queries. The most extreme example is probably the statement used by the application's connection health check: SELECT 1 min=0.001,

Re: Where to store Blobs?

2019-03-13 Thread Hannes Erven
Hi, Am 13.03.19 um 15:28 schrieb Thomas Güttler: Where do you store Blobs? Within PostgreSQL, of course. The system I have in mind stores ZIP and PDF files, usually a few MBs each; we're currently at a total of about 100 GB and there are no evident problems. For this application, it is

Re: Unused files in the database directory after crashed VACUUM FULL

2019-02-10 Thread Hannes Erven
Hi again, Am 10.02.19 um 16:41 schrieb Tom Lane: Hannes Erven writes: I've just had a "VACUUM FULL " crash due to 100% disk usage. Clearly my fault, I was expecting the new table to be small enough. What do you mean by "crash" exactly? A normal transactional failure

Unused files in the database directory after crashed VACUUM FULL

2019-02-10 Thread Hannes Erven
Hi, I've just had a "VACUUM FULL " crash due to 100% disk usage. Clearly my fault, I was expecting the new table to be small enough. After freeing up space, restarting the cluster and issuing another VACCUM FULL, I noticed that the cluster was way bigger that it should be. In the base//

Re: Does creating readOnly connections, when possible, free up resources in Postgres?

2019-01-27 Thread Hannes Erven
Hi David, > I saw that when you create a JDBC connection, you can specify > readOnly=true. Would doing so somehow help Postgres manage its other > connections? if you know that a certain connection will be ready-only, you could use a more aggressive pooling strategy. Usually, a connection

Force Reconnect of streaming replication

2018-11-28 Thread Hannes Erven
Hi, consider a PG10 master center, streaming via internet to another site. The receiving site has a fast primary uplink and much slower backup link. When the primary link goes down, all traffic is routed through the backup connection. The streaming replication's connection drops and is

Re: recovery_target_time and WAL fetch with streaming replication

2018-05-13 Thread Hannes Erven
Michael, Am 2018-05-13 um 08:23 schrieb Michael Paquier: On Sun, May 13, 2018 at 01:39:48AM +0200, Hannes Erven wrote: what is Postgresql's strategy when to fetch WAL from the master while in streaming replication, and could it be tweaked? Fetching WAL from a primary (or another standby

recovery_target_time and WAL fetch with streaming replication

2018-05-12 Thread Hannes Erven
Hi, what is Postgresql's strategy when to fetch WAL from the master while in streaming replication, and could it be tweaked? I'm using a physical streaming replication slave to have a database lagging behind about one month behind the primary, by setting "recovery_target_time" to the

Re: postgres on physical replica crashes

2018-04-20 Thread Hannes Erven
Hi Greig, just last week I experienced the same situation as you on a 10.3 physical replica (it even has checksums activated), and a few months ago on 9.6 . We used the same resolution as you we, and so far we haven't noticed any problems with data integrity on the replicas. The logs

Re: array_agg and/or =ANY doesn't appear to be functioning as I expect

2018-01-20 Thread Hannes Erven
Hi Rhys, Am 2018-01-21 um 02:42 schrieb Rhys A.D. Stewart: Greetings All, I'm having an issue which is very perplexing. The having clause in a query doesn't appear to be working as I expect it. Either that or my understanding of array_agg() is flawed. > > [...] with listing as (