Re: Use of max_slot_wal_keep_size parameter

2024-03-26 Thread Don Seiler
7;s tighter nowadays, but I really doubt that > it's exact-to-the-kilobyte-at-all-times. > In this case, the total volume size was 60GB and we had the parameter set to 58GB but I imagine that can still be overwhelmed quickly. Maybe we should target a 20% buffer zone? We have wal_kee

Use of max_slot_wal_keep_size parameter

2024-03-26 Thread Don Seiler
deals with situations where the replication slot lag is a factor? Don. -- Don Seiler www.seiler.us

Re: malloc errors in psql with libpq 16.1 on Mac

2023-11-27 Thread Don Seiler
led) Does this mean that downgrading libpq wouldn't help? He'd have to downgrade openssl instead (or wait for a fix from somewhere upstream)? Don. -- Don Seiler www.seiler.us

malloc errors in psql with libpq 16.1 on Mac

2023-11-27 Thread Don Seiler
ences or if this is a known issue? -- Don Seiler www.seiler.us

Re: Logical Replication vs. Free Replication Slots

2023-10-03 Thread Don Seiler
On Tue, Oct 3, 2023 at 10:27 AM Don Seiler wrote: > On the source (PG 12.15) instance, we have bumped max_replication_slots > and max_wal_senders to 50, and max_sync_workers_per_subscription to 10. > Forgot to note that on the subscriber (PG 15.4) instance, max_sync_workers_per_subscr

Logical Replication vs. Free Replication Slots

2023-10-03 Thread Don Seiler
20 replication slots created (out of 50 max), 3 of which are the subscriptions and the rest are the tablesyncs workers. So I'm trying to make sense of why it would tell me to increase max_replication_slots when I don't appear to be anywhere near the max. -- Don Seiler www.seiler.us

Re: Calculating vm.nr_hugepages

2023-08-30 Thread Don Seiler
es VM sizes. There's obviously going to be a little extra HugePages that goes unused, but these VMs are dedicated for postgresql usage and shared_buffers_size defaults to 25% of VM memory so there's still plenty to spare. But we use this so we can configure vm.nr_hugepages at deployment time via Chef. Don. -- Don Seiler www.seiler.us

Re: Runaway Initial Table Syncs in Logical Replication?

2023-08-04 Thread Don Seiler
is from a different pid, maybe some kind of cleanup process? It was doing this for what seemed like all of the sync slots: 2023-08-03 18:47:47.975 UTC [3303] migrator@foo - sub01 ERROR: replication slot "pg_19742_sync_17238_7263122209699118815" does not exist 2023-08-03 18:47:47.975 UTC [3303] migrator@foo - sub01 STATEMENT: DROP_REPLICATION_SLOT pg_19742_sync_17238_7263122209699118815 WAIT -- Don Seiler www.seiler.us

Runaway Initial Table Syncs in Logical Replication?

2023-08-03 Thread Don Seiler
sync workers in action so this was a big surprise. Is this expected behavior? -- Don Seiler www.seiler.us

Re: Native Logical Replication Initial Import Qs

2023-06-22 Thread Don Seiler
On Wed, Jun 7, 2023 at 4:30 PM Jeremy Schneider wrote: > On 6/7/23 2:12 PM, Don Seiler wrote: > > On the logical replication front, the concern is with the initial data > > import that happens when the subscription is created (by default). I > > know that you can tell th

Native Logical Replication Initial Import Qs

2023-06-07 Thread Don Seiler
not. I know to only use the minimal indexes required on the destination side (ie identity-related indexes) and omit other indexes and constraints until after the data is loaded, but that is true for either method. Thanks, Don. -- Don Seiler www.seiler.us

autovacuum on primary blocking queries on replica?

2022-05-27 Thread Don Seiler
ondering if I'm on the right trail or if there is a much firmer explanation for what happened. Thanks, Don. -- Don Seiler www.seiler.us

Re: Dangerous Naming Confusion

2021-03-30 Thread Don Seiler
On Mon, Mar 29, 2021 at 5:22 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Mar 29, 2021 at 3:20 PM Adrian Klaver > wrote: > >> On 3/29/21 3:00 PM, Don Seiler wrote: >> > >> > I'm wondering if this is expected behavior that PG us

Dangerous Naming Confusion

2021-03-29 Thread Don Seiler
logic was used in an UPDATE and ended up locking all rows in a 5M row table and brought many apps to a grinding halt. Thankfully it was caught and killed before it actually updated anything. Thanks, Don. -- Don Seiler www.seiler.us

Re: Mixed Locales and Upgrading

2020-06-15 Thread Don Seiler
#x27;m wondering if there is risk or harm in running an UPDATE pg_database command on postgres/template0/template1 as needed and re-indexing afterward. -- Don Seiler www.seiler.us

Re: template0 needing vacuum freeze?

2020-05-18 Thread Don Seiler
. We shouldn't be at risk of hitting wraparound though (only 52% there). Don. -- Don Seiler www.seiler.us

Re: template0 needing vacuum freeze?

2020-05-18 Thread Don Seiler
> by reducing "autovacuum_vacuum_cost_delay" to 2ms or less, and by > increasing > "maintenance_work_mem". > All autovacuum settings on this DB are default. Cost delay is at the default 20ms. maintenance_work_mem I've already increased to 512MB (this VM has 8GB RAM). -- Don Seiler www.seiler.us

Re: template0 needing vacuum freeze?

2020-05-16 Thread Don Seiler
bles in our app DB triggering the autovacuum "to prevent wrap-around" when they reach 200M. That's what had me concerned to see template0 with an age over 1B and no autovacuum even trying to clean up for it. Don. -- Don Seiler www.seiler.us

template0 needing vacuum freeze?

2020-05-16 Thread Don Seiler
progress, with over 850M dead tuples according to pg_stat_all_tables. I estimate 3-4 more days to go on that one. Once that's done I'll be scheduling manual vacuum jobs. Just wondering if that would somehow affect regular template0 cleanup though. I don't see anything in postgres log relat

Re: Mixed Locales and Upgrading

2020-04-29 Thread Don Seiler
On Tue, Apr 7, 2020 at 11:41 AM Don Seiler wrote: > > Follow-up question, the locale setting on the host would still be set to > en_US (as would the postgres and template0 databases). Should I look to > change that locale on the system to en_US.UTF-8, or even just for the > pos

Re: Mixed Locales and Upgrading

2020-04-07 Thread Don Seiler
On Mon, Mar 30, 2020 at 4:39 PM Don Seiler wrote: > On Mon, Mar 30, 2020 at 4:30 PM Tom Lane wrote: > >> Don Seiler writes: >> > Actually, would I need to re-index on text columns that we know contain >> > UUID strings? UUID characters seem to be pretty basic alph

Re: Mixed Locales and Upgrading

2020-03-30 Thread Don Seiler
On Mon, Mar 30, 2020 at 4:30 PM Tom Lane wrote: > Don Seiler writes: > > Actually, would I need to re-index on text columns that we know contain > > UUID strings? UUID characters seem to be pretty basic alphanumeric ASCII > > characters. > > I think you're all ri

Re: Mixed Locales and Upgrading

2020-03-30 Thread Don Seiler
On Sun, Mar 22, 2020 at 4:48 PM Don Seiler wrote: > > Here's the fun part. A lot of the tables use UUIDv4 strings for primary > keys. However these are stored in text/varchar columns. > Actually, would I need to re-index on text columns that we know contain UUID strings? UUID c

Re: Mixed Locales and Upgrading

2020-03-22 Thread Don Seiler
best course of action in my opinion if you have any > doubts, because that's safe even if it has a higher cost. > Here's the fun part. A lot of the tables use UUIDv4 strings for primary keys. However these are stored in text/varchar columns. -- Don Seiler www.seiler.us

Re: Mixed Locales and Upgrading

2020-03-17 Thread Don Seiler
after testing all of that heavily)? What are the ramifications of changing collation like that? Should we consider rebuilding indexes ASAP after that? Don. -- Don Seiler www.seiler.us

Re: Mixed Locales and Upgrading

2020-03-17 Thread Don Seiler
On Tue, Mar 17, 2020 at 8:06 AM Don Seiler wrote: > On Mon, Mar 16, 2020 at 10:28 AM Tom Lane wrote: > >> > Well, in principle you could likewise manually update pg_database's >> datcollate and datctype columns to say "en_US.utf8". However, there's >

Re: Mixed Locales and Upgrading

2020-03-17 Thread Don Seiler
would logical replication safely replicate and convert the data until we could then cut over? Thanks, Don. -- Don Seiler www.seiler.us

Mixed Locales and Upgrading

2020-03-16 Thread Don Seiler
be sure. Is logical replication an option here? Either maintaining the mixed environment or converting everything to en_US.UTF-8? I'm relatively new in this shop but I'm told they didn't mean to use en_US and there's no reason they wouldn't want to just use the standard/default UTF-8. Thanks, Don. -- Don Seiler www.seiler.us

Re: Not Null Constraint vs Query Planning

2020-03-02 Thread Don Seiler
On Mon, Mar 2, 2020, 12:30 Vik Fearing wrote: > On 02/03/2020 18:09, Don Seiler wrote: > > The REAL reason for this is that I'm wondering if I created a NOT NULL > > check constraint with "NOT VALID" would that then NOT be considered in > such > > a "

Not Null Constraint vs Query Planning

2020-03-02 Thread Don Seiler
Planning time: 0.390 ms Execution time: 2339.274 ms (6 rows) -- Don Seiler www.seiler.us

Re: Postgres 11 chooses seq scan instead of index-only scan

2019-01-24 Thread Don Seiler
optimizer/planner when evaluating execution plans. -- Don Seiler www.seiler.us

Re: Compile and build portable postgresql for mac

2018-10-25 Thread Don Seiler
provides a clean CLI for building and using all the various supported versions: https://github.com/theory/pgenv Don. -- Don Seiler www.seiler.us

Re: Replication question

2018-10-22 Thread Don Seiler
lication will only read from the WAL files in the $PGDATA/pg_xlog directory. It will not read from archives. So, yes, you would need your NFS mount on the replica (or otherwise copy the archive files to the replica). Don. -- Don Seiler www.seiler.us

Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Don Seiler
n index on that field. Even as I experiment with some query rewrites, the EXPLAIN ANALYZE always says rows=75. I'm *very* curious to see why it is using that value. Don. -- Don Seiler www.seiler.us

Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Don Seiler
ecords IS NOT NULL; The foo.gifts table is pretty much the core table of our database. It's big and very active. There is an index on date_added but not yet on date_gifted. I'm working to re-write the query while the dev sees if we even need this query anymore. On Wed, Aug 15, 2018 at 2:39

Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Don Seiler
s that is far more selective and avoids throwing rows away. However I'm very interested in why every node dealing with the gifts table thinks rows=75 when the actual is much, much higher. And 75 seems like too round of a number to be random? -- Don Seiler www.seiler.us

Re: Vacuum process waiting on BufferPin

2018-08-14 Thread Don Seiler
probably look to set it but make sure to point out that it is just a safety net to let DB maintenance run and they should make sure their work is committed cleanly if they want to keep it. Don. -- Don Seiler www.seiler.us

Re: Vacuum process waiting on BufferPin

2018-08-14 Thread Don Seiler
way. But if they're also NOT closing cursors, that seems like another bad practice to correct. Would commit/rollback automatically close cursors opened in that transaction? Don. -- Don Seiler www.seiler.us

Re: Vacuum process waiting on BufferPin

2018-08-14 Thread Don Seiler
On Mon, Aug 13, 2018 at 5:55 PM, Vick Khera wrote: > On Mon, Aug 13, 2018 at 5:19 PM, Don Seiler wrote: > >> >> I don't quite follow this. What circumstances would lead to this >> situation? >> > > BEGIN WORK; > DECLARE CURSOR ... ; > FETCH ...;

Re: Vacuum process waiting on BufferPin

2018-08-13 Thread Don Seiler
On Mon, Aug 13, 2018 at 4:04 PM, Don Seiler wrote: > > > Anyway, my next step is getting the OK to terminate those idle in > transaction sessions to see if that gets my vacuum job moving. Meanwhile > I'll ask a dev to sort out why they might be sitting idle in transaction, >

Re: Vacuum process waiting on BufferPin

2018-08-13 Thread Don Seiler
or what its worth, these sessions are backend reporting jobs, not user interfacing at all. Don. -- Don Seiler www.seiler.us

Vacuum process waiting on BufferPin

2018-08-13 Thread Don Seiler
e I could/should also look to get to the root cause of this. Don. -- Don Seiler www.seiler.us

Re: Issues on 9.5 to 9.6 Upgrade.

2018-06-13 Thread Don Seiler
On Wed, Jun 13, 2018 at 11:16 AM, wrote: > > > Can anyoen explain WHY there is such a big difference? Is it the SQL > statement or a bug in the pgdump ? > > Did you analyze the database after upgrading? Or at least the tables in question? Those are very different plan

Re: Bad performance with cascaded deletes

2018-06-12 Thread Don Seiler
On Tue, Jun 12, 2018 at 10:48 AM, Don Seiler wrote: > On Tue, Jun 12, 2018 at 2:26 AM, Haug Bürger > wrote: > >> >> "availability_cache_ac_session_id_fkey" FOREIGN KEY (ac_session_id) >> REFERENCES zpg_data.session(id) ON DELETE CA

Re: Bad performance with cascaded deletes

2018-06-12 Thread Don Seiler
atically indexed and that can lead to horrible performance on cascading operations like this. -- Don Seiler www.seiler.us

Re: initdb failing (10.4 centos7)

2018-05-19 Thread Don Seiler
ld > do this. > Are you using the PGDG repo packages, or the default CentOS repo packages? You should use PGDG and those should install under /var/lib/pgsql. Don. -- Don Seiler www.seiler.us

Re: New website

2018-04-18 Thread Don Seiler
judgment on the site design until it is functioning. Those links work fine for me on the new site. I haven't hit any issues yet in my casual click-testing. -- Don Seiler www.seiler.us

Re: Archiving Data to Another DB?

2018-04-11 Thread Don Seiler
On Wed, Apr 11, 2018 at 1:38 PM, Don Seiler wrote: > > Yeah, I saw the same with a 132 row insert. Now imagine that with a > monthly 50 million row insert or delete. :p Thanks for the confirmation! > I went back to look at the postgres logs on my dev server. These logs are rotated o

Re: Archiving Data to Another DB?

2018-04-11 Thread Don Seiler
rameters: $1 = '3', > $2 = 'three', $3 = 'f' > > So much for that idea(:= Yeah, I saw the same with a 132 row insert. Now imagine that with a monthly 50 million row insert or delete. :p Thanks for the confirmation! I'm definitely leaning towards the copy/load/delete method. Don. -- Don Seiler www.seiler.us

Re: Archiving Data to Another DB?

2018-04-11 Thread Don Seiler
On Wed, Apr 11, 2018 at 1:13 PM, Don Seiler wrote: > > I had considered this as well, as this would allow me to rollback the > delete (assuming my intel on postgres_fdw transactions was correct, which > it may not be after all). I wondered if a remote insert would be broken up >

Re: Archiving Data to Another DB?

2018-04-11 Thread Don Seiler
like the remote delete was, as that would be equally unappealing for the same reasons. But obviously worth confirming. Don. -- Don Seiler www.seiler.us

Archiving Data to Another DB?

2018-04-11 Thread Don Seiler
to hear what others might be doing for tasks like this. Don. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-19 Thread Don Seiler
than symlinking anyway. I'll look to do that in my next round of config changes. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-19 Thread Don Seiler
They aren't needed for database restore or recovery. Don. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-19 Thread Don Seiler
t ready to make the changes necessary in the production environment. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-19 Thread Don Seiler
ut for these cases I just recover it to the first consistent point and open it for testing (or backups in this case). Thanks for all your help! Don. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-19 Thread Don Seiler
ession as well but that pg_basebackup does do. I did come up with a sort of Rube Goldberg-esque workaround for now involving using a clone of the prod standby VM from Veeam backup to use as the backup source (after stopping recovery and opening it as a standalone DB). Don. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-19 Thread Don Seiler
On Mon, Feb 19, 2018 at 8:23 AM, David Steele wrote: > > Either is fine with me, but as Michael says I might miss postings to > -general. I'm sure somebody else would catch it, though. > OK, I'll make use of the issues tracker going forward. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-19 Thread Don Seiler
hed my master/replica clone setup but I'll test there as well. I just had a couple questions about the mechanics. -- Don Seiler www.seiler.us

Re: pgBackRest backup from standby

2018-02-18 Thread Don Seiler
see any mention of a forum or list on their website, and there have been lots of pgBackRest questions on this list in the past so I settled on this one. Don. -- Don Seiler www.seiler.us

pgBackRest backup from standby

2018-02-18 Thread Don Seiler
Does pgBackRest need to be installed and configured on the primary as well? Thanks, Don. -- Don Seiler www.seiler.us

vacuumdb --all Parallel Feature Request

2018-02-15 Thread Don Seiler
alyze-only I wonder if it wouldn't be a bad idea to also mention the --jobs=N parameter option in that blurb. Yes it's in the --help text but it wouldn't be bad to highlight its availability. Don. -- Don Seiler www.seiler.us

Could not read block in file

2018-01-18 Thread Don Seiler
I don't see any errors in /var/log/messages that would incidate any filesystem issues either. Obviously the worry is for possible corruption. Granted this is "only" pre-prod but there will be concerns from the business side prior to upgrading our prod DB (currently 9.2.22). What else can/should I check here to make sure there isn't something wrong with this database cluster? -- Don Seiler www.seiler.us