How to calculate shared memory size

2020-09-15 Thread Rébeli-Szabó Tamás
Hello all, I want to do a proper calculation of the number of huge pages needed for PostgreSQL to start. To do that, I need a good approximation of how much shared memory will be requested at server startup. Looking at the shared memory calculation in the source (ipci.c), I can see that tw

How to calculate shared memory size

2020-09-15 Thread Rébeli-Szabó Tamás
Hello all, I want to do a proper calculation of the number of huge pages needed for PostgreSQL to start. For that I need to know how much shared memory will be allocated at startup. Looking at the shared memory calculation in the source (ipci.c), I can see that two terms stand out: siz

Re: REINDEX vs VACUUM

2023-01-04 Thread Rébeli-Szabó Tamás
Here is my understanding: REINDEX recreates the index from scratch, using the data stored in the underlying table. It is the same as dropping and recreating the index manually, with regard to the impact on the index file. It can free up physical space in the file system. REINDEX will not vacuu

Re: REINDEX vs VACUUM

2023-01-04 Thread Rébeli-Szabó Tamás
CUUM FULL (copy the table, create new indices and other metadata all in one command) actually vacuums tables.  It's a misleading name. Something like REBUILD TABLE would be a better name. On 1/4/23 07:25, Rébeli-Szabó Tamás wrote: Here is my understanding: REINDEX recreates the index from scr

Re: curious postgres (crash) recovery behavior

2023-01-04 Thread Rébeli-Szabó Tamás
I think your log shows a continued archive recovery (PITR), not a crash recovery. For a crash recovery (automatic recovery), you would see something like this in the server log: LOG:  database system was interrupted; last known up at 2022-12-23 20:50:13 CET LOG:  database system was not pro

recovery long after startup

2023-03-30 Thread Rébeli-Szabó Tamás
Hello All, I have noticed that a PostgreSQL 13 server went into recovery mode for 2 seconds during normal operation, not at startup, preventing users from connecting.  Here is a log excerpt: 2023-03-29 10:45:46.973 CEST [114782] [unknown]@[unknown] LOG:  connection received: host=10.150.52.16