Re: Partitioned Tables and ORDER BY - Mailing list pgsql-performance

From Michal Szymanski
Subject Re: Partitioned Tables and ORDER BY
Date
Msg-id b857709f-6d60-430b-90c1-b266b5d62e06@g23g2000yqh.googlegroups.com
Whole thread Raw
In response to Partitioned Tables and ORDER BY  (Joe Uhl <joeuhl@gmail.com>)
Responses Re: Partitioned Tables and ORDER BY  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
List pgsql-performance
We have similar problem and now we are try to find solution. When you
execute query on partion there is no sorting - DB use index to
retrieve data and if you need let say 50 rows it reads 50 rows using
index. But when you execute on parent table query optymizer do this:

  ->  Sort  (cost=726844.88..748207.02 rows=8544855 width=37739)
(actual time=149864.868..149864.876 rows=50 loops=1)

it means 8544855 rows should be sorted and it takes long minutes. We
have simpler situation than you and I will try to find solution
tommorow :)

Michal Szymanski
http://blog.szymanskich.net
http://techblog.freeconet.pl/

pgsql-performance by date:

Previous
From: 旭斌 裴
Date:
Subject: table full scan or index full scan?
Next
From: Michal Szymanski
Date:
Subject: Domain vs table