skip to Main Content

Postgresql – Select count query very slow on cold cache

Problem The following query takes 42 seconds when most of the data in not cached: EXPLAIN (ANALYZE, BUFFERS) select count(*) from packages where company_id = 178381; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=395914.63..395914.63 rows=1 width=8) (actual time=42411.940..42411.942 rows=1 loops=1) Buffers: shared hit=21775…

VIEW QUESTION
Back To Top
Search