Re: distinct on extract returns composite type

2019-10-07 Thread Michael Lewis
As long as we are on the performance list and not general, it might be worth noting that partitioning should be defined directly on the data and not on a function result I believe. If you always do the extract year and extract quarter thing, it may work out just fine. But just a regular btree index

Re: Slow PostgreSQL 10.6 query

2019-10-07 Thread Behrang Saeedzadeh
Thanks for the tip! Regards, Behrang (sent from my mobile) On Mon, Oct 7, 2019, 07:37 Tomas Vondra wrote: > On Tue, Oct 01, 2019 at 11:42:33PM +1000, Behrang Saeedzadeh wrote: > >Thanks. That eliminated the bottleneck! > > > >Any ideas why adding ORDER BY to the subquery also changes the plan i