

Worker 1: Sort Method: top-N heapsort Memory: 127kB Worker 0: Sort Method: top-N heapsort Memory: 128kB Sort Method: top-N heapsort Memory: 128kB Test=# explain analyze select * from t1 where num > 10000 order by num limit 1000 Let's consider a simple example – two tables, each has 2 bigint columns, id (sequential) and num (random), with exactly the same content the second table has an index on num while the first one doesn't have it: For database systems, which mostly perform IO-intensive operations, dealing with too many data pages (or "buffers", "blocks" – depending on the context) is the most popular reason for poor performance.įurther, we will consider several examples of EXPLAIN (ANALYZE) plans and discuss why everyone needs to use the BUFFERS option when troubleshooting the performance of a particular query. The BUFFERS option helps us see how much IO work Postgres did when executing each node in the query execution plan. EXPLAIN ANALYZE or EXPLAIN (ANALYZE, BUFFERS)? I am sure it has to be enabled and used by everyone who needs to do some SQL optimization work. Here it is: the EXPLAIN command has the BUFFERS option disabled by default. However, there is a specific artificial barrier that is rather influential and which is relatively easy to eliminate. They limit the number of engineers possessing well-developed Postgres query optimization skills. insufficiency of good educational materials.Īll these barriers are reasonable.lack of certain capabilities in Postgres observability tools that are still developing (though, at a good pace),.lack of good "playground" environments where people can experience how databases work at a larger scale,.

the difficulty of the field of system performance in general,.

There are many objective reasons for this, such as: SQL query optimization is challenging for those who have just started working with PostgreSQL. Dagnello NASA/JPL/Space Science Institute
