Re: pg12 partitions show bad performance vs pg96

From: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: pg12 partitions show bad performance vs pg96
Date: 2020-03-09 10:31:15
Message-ID: CA+t6e1nXcPB37M3qTkBCcaQoALUsfr7=YzAHWajLn4vRhoPLHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>
> I tried to do even something simpler, run the query with only the
> partition column in the where clause and the results werent good for pg12 :
>
PG12 :
postgres=# explain analyze select * from iot_data where device=51;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------
Gather (cost=1000.00..514086.40 rows=1027284 width=37) (actual
time=6.777..61558.272 rows=1010315 loops=1)
Workers Planned: 2
Workers Launched: 2
-> Parallel Seq Scan on iot_data_0 (cost=0.00..410358.00 rows=428035
width=37) (actual time=1.152..61414.483 rows=336772 loops=3)
Filter: (device = 51)
Rows Removed by Filter: 9764341
Planning Time: 15.720 ms
Execution Time: 61617.851 ms
(8 rows)

PG9.6
postgres=# explain analyze select * from iot_data where device=51;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
Seq Scan on iot_data (cost=0.00..2083334.60 rows=976667 width=37) (actual
time=21.922..16753.492 rows=1010315 loops=1)
Filter: (device = 51)
Rows Removed by Filter: 98989685
Planning time: 0.119 ms
Execution time: 16810.787 ms
(5 rows)

> Besides hardware, anything else worth checking ? the machine are
> identical in aspect of resources.
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Justin Pryzby 2020-03-09 12:12:13 Re: pg12 partitions show bad performance vs pg96
Previous Message Mariel Cherkassky 2020-03-09 10:15:50 Re: pg12 partitions show bad performance vs pg96