Quantcast
Channel: User Frank Heikens - Database Administrators Stack Exchange
Browsing all 124 articles
Browse latest View live

Comment by Frank Heikens on Disk space and performance issues while updating...

@Sam, your next update batch can use the reusable space after VACUUM has done its job. There is no reason to give this space back to the OS, using VACUUM FULL or so.

View Article


Answer by Frank Heikens for In what case can a new transaction claim an older...

A sequence is a simple number generator. When you ask for a number, it gives you a new one. Unless you mess with the settings of the sequence or use a wraparound, you will never ever get a number that...

View Article


Comment by Frank Heikens on postgres vs mongodb for storing logs

It depends on skills and the complete requirements. When you're used to Oracle but can't use Oracle for this but still want SQL for the daily work, PostgreSQL is a natural match.

View Article

Comment by Frank Heikens on PostgreSQL CTE Recursion - How to Improve...

The index ix_resource_dependency_prior_id could benefit from adding the column label since much filtering has been done. barcode also needs to be in an index.

View Article

Comment by Frank Heikens on Optimize Postgres query for finding string...

Use explain(analyze, verbose, buffers, settings) to get the query plan and see where the time is spent. And you can create an index on LOWER(code): CREATE INDEX idx_ discount_codes_lower_code ON...

View Article


Comment by Frank Heikens on How do I tell Postgres to only scan the newest...

Offtopic: extract(epoch from age) < 60*60*24*14 /*two weeks*/ can be rewritten as age < INTERVAL '2 weeks'

View Article

Comment by Frank Heikens on Which configurations should be set in order to...

So the goal is exactly reproducible queries. The database system, operating system and the hardware all try to be smart. There is caching everywhere. You have to run at least multiple long running...

View Article

Comment by Frank Heikens on How to prevent PostgreSQL logging Patroni health...

Offtopic: I have PostgreSQL 15.2 You're missing 2 years of patches, the current version is 15.10.

View Article


Answer by Frank Heikens for Can a new transaction claim an older sequence id?

A sequence is a simple number generator. When you ask for a number, it gives you a new one. Unless you mess with the settings of the sequence or use a wraparound, you will never ever get a number that...

View Article


Comment by Frank Heikens on What could cause _all_ queries to slow down on a...

Check the database and server activity. Please share the results, in plain text

View Article

Comment by Frank Heikens on Is there any practice to align file system block...

This was important during the days of rotating hard drives but less on SSDs. What problem are you trying to solve?

View Article

Comment by Frank Heikens on Migrating trigger from MariaDB to PostgreSQL

Unlikely. PostgreSQL also works differently, you have to check the logic you need and how to implement this into the trigger function. And then create the right trigger, using this trigger function.

View Article

Answer by Frank Heikens for PostgreSQL alternative to SQL Server’s `try_cast`...

It's a fairly old question but the answer is now sort of obsolete. Since PostgreSQL version 16 you can use the function pg_input_is_valid() to see if your input is valid for your data type:SELECT...

View Article


Comment by Frank Heikens on What should I do so returning 200 rows is at...

Could you please use explain(analyze, verbose, buffers, settings) to get the whole picture? To me, it looks like the first query plan is not the best plan. And in this case, that is slower than the...

View Article

Comment by Frank Heikens on Microsoft asking me to remove Postgis to migrate...

Step 0: Make a backup!

View Article


Comment by Frank Heikens on PostgreSQL - Row Estimates Leading to Nested Loop...

Changing work_mem will not change anything; all sorting is already done in memory. Looking at this query, I think you have to rewrite it and make it (much) simpler. You might also need some additional...

View Article

Comment by Frank Heikens on Same query, same data, one server query planner...

The costs are based on the version, the configuration and the statistics. Besides that you need ANALYZE to keep the stats up to date.

View Article


Answer by Frank Heikens for Why PostgreSQL v10 and v16 have slightly...

The behavior of pg_dump changed with version 14:Allow pg_dump to dump only certain extensionsOlder versions dump all extensions in the backup, since version 14 by default all non-system extensions in...

View Article

Comment by Frank Heikens on Zip Postgres Backup with directory structure -Fd

very slow is an opinion based on expectations, it's not something you can measure. So how long does it take to create a back, how fast is your storage system, how fast is your CPU, how much memory, is...

View Article

Comment by Frank Heikens on Why does Postgresql use a Seq Scan on the first...

Estimate: rows=1, reality: and 2,902,720 rows need to be deleted. There is something wrong with the estimates; please run ANALYZE on this table. And why do you use the function to_timestamp() for a...

View Article
Browsing all 124 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>