Re: Planning performance problem (67626.278ms) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Planning performance problem (67626.278ms)
Date
Msg-id 767433.1619015825@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planning performance problem (67626.278ms)  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Planning performance problem (67626.278ms)
List pgsql-performance
David Rowley <dgrowleyml@gmail.com> writes:
> FWIW, here's a simple test case that shows the problem in current master.

This isn't telling the whole story.  That first EXPLAIN did set the killed
bits in the index, so that subsequent ones are fairly fast, even without
VACUUM:

regression=# explain select * from a where a < 10000000;
                         QUERY PLAN                         
------------------------------------------------------------
 Seq Scan on a  (cost=0.00..169247.71 rows=9998977 width=4)
   Filter: (a < 10000000)
(2 rows)

Time: 3711.089 ms (00:03.711)
regression=# explain select * from a where a < 10000000;
                         QUERY PLAN                         
------------------------------------------------------------
 Seq Scan on a  (cost=0.00..169247.71 rows=9998977 width=4)
   Filter: (a < 10000000)
(2 rows)

Time: 230.094 ms

Admittedly this is still more than after VACUUM gets rid of the
index entries altogether:

regression=# vacuum a;
VACUUM
Time: 2559.571 ms (00:02.560)
regression=# explain select * from a where a < 10000000;
                   QUERY PLAN                    
-------------------------------------------------
 Seq Scan on a  (cost=0.00..0.00 rows=1 width=4)
   Filter: (a < 10000000)
(2 rows)

Time: 0.698 ms

However, I'm skeptical that any problem actually remains in
real-world use cases.

            regards, tom lane



pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: Planning performance problem (67626.278ms)
Next
From: Luca Ferrari
Date:
Subject: hint in determining effective_io_concurrency