pg_sql | Unsorted

Telegram-канал pg_sql - PostgreSQL

2830

English speaking PostgreSQL public chat. This group is for discussions on PostgreSQL-related topics and strives to provide best-effort support as well.

Subscribe to a channel

PostgreSQL

Don't full vacuum at first.

Generally, it's not necessary.
At the very last there is a pg_repack, but most of the time it doesn't needed either.

Second approach is to use logical replication and switchover for maintenance. Requires a lot of effort, though, and kinda fragile (complex machinery underneath, a lot of sequential operations on replicas...)

Читать полностью…

PostgreSQL

4b) check for any views that refer to the old table and redefine them (ask me how I know... 🤪)

Читать полностью…

PostgreSQL

I need support for postgresql

Читать полностью…

PostgreSQL

And you also config pg_receive_wal like a synchronous standby and you would not lose any info and you also will have some reduction of performance due to wait of confirmation

Читать полностью…

PostgreSQL

I think pg_backrest doesn't support pg_receive_wal

Читать полностью…

PostgreSQL

If you use backup tool based on archiver you would lose archive_timeout data

Читать полностью…

PostgreSQL

Yes, but if you only have pgBackRest as a means to retrieve the WAL then you have to wait for the entire last WAL file to be archived first, either by pg_switch_wal or PG deciding to archive it of it's own initiative because of archive_timeout or the WAL file being full.

Читать полностью…

PostgreSQL

Sometimes it can be ones you do not expect, e.g. we had system table bloat with pg_attribute/index etc. because our temp search results are stored as new unlogged tables in the app and so there was a lot of metadata churn. Can be bad for perf if you let that get away from you.

Читать полностью…

PostgreSQL

It would be good to understand why you need a vacuum full given that a database in good health should do just fine with autovacuum

Читать полностью…

PostgreSQL

Is it actually the tables that are bloated or the indexes? If the latter consider also the native REINDEX...CONCURRENTLY?

Читать полностью…

PostgreSQL

I will now elaborate on my current activities. We are experiencing a significant downtime of approximately 8 hours for a full vacuum during database maintenance, given that some of our databases are around 1TB in size. This extended downtime is a considerable concern. Do you have any recommendations for reducing or eliminating this downtime?

Читать полностью…

PostgreSQL

Hi Team, I’d like to understand best practices for PostgreSQL database maintenance on a live production instance with zero or minimal downtime.

Читать полностью…

PostgreSQL

It is similar in its effect, but the implementation is quite different. pgBackRest is based on checksums (so it still has to read a lot on the server) while the builtin incremental method relies on a logfile tracking all changed pages.

Also, pgbackrest can't combine old backups to create new full backups, AFAIK.

Читать полностью…

PostgreSQL

I usually say to do it from 100GB onwards.

Читать полностью…

PostgreSQL

Seems like it is very popular in the Oracle realm. One wonders why... Probably a good source for consulting hours...

Читать полностью…

PostgreSQL

I usually don't recommend for less then 2TB.

(Except archive pseudo-partitioning, which often become usable much faster)

Читать полностью…

PostgreSQL

0. Reconsider if you really want this.

1. Create your partitioned table. See https://www.dbi-services.com/blog/postgresql-partitioning-4-hash-partitioning/ for an example of creating a hash partitioned table

2. Copy the data from the old to the partitioned table (think about supporting data changes during the copy or not)

3. Lock both tables with an access exclusive lock

4. Rename the old table to table_old, rename the partitioned table to the original table name.

5. Commit

6. Check of everything works correctly

7. Drop your old table

Читать полностью…

PostgreSQL

this is a request from application team, do you know what is the best method to archive it?

Читать полностью…

PostgreSQL

lose archive_timeout data is like the scenario i said before?
pg_receive_wal means it will backup the WAL that is being written now and not yet being archived?

Читать полностью…

PostgreSQL

There are other backup tools like barman that allow you to have a standby using pg_receive_wal to avoid ARCHIVER lose of data

Читать полностью…

PostgreSQL

so it's possible only if the WAL will be archived right?

Читать полностью…

PostgreSQL

if im taking full backup using pgbackrest then i insert more data and capture the timestamp right before this insert.
is it possible to restore to this point? or only if the WALs been archived by pgbackrest? without issuing pg_switch_wal

Читать полностью…

PostgreSQL

Also figure out where your bloat is and target it accordingly, queries like those in https://github.com/ioguix/pgsql-bloat-estimation/tree/master and https://wiki.postgresql.org/wiki/Show_database_bloat#Query_from_check_postgres

Читать полностью…

PostgreSQL

Well, you had it coming with vacuum full. Best idea would be to use pg_repack but as @Suman_PHF10073 said that requires keys

Читать полностью…

PostgreSQL

Pgrepack addin you could use provided tables has primary keys

Читать полностью…

PostgreSQL

Can you be a bit more specific? Is there something you struggle with?

Читать полностью…

PostgreSQL

Great! will test this out.

Читать полностью…

PostgreSQL

is pgBackRest incremental is more or less like pg_basebackup incremental in version 17?

Читать полностью…

PostgreSQL

That's because some Oracle book wrote partitioning = 10X fast and people without any business need or natural key to partition also want to partition. I remembered old oracle blog saying if table is >2GB consider partitioning. 😂

Читать полностью…

PostgreSQL

As you probably know I have a very strong opinion about hash partitioning, even for sharding. The scaling and flexibility is just too limited for me.

Читать полностью…
Subscribe to a channel