From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
---|---|
To: | Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: POC: GROUP BY optimization |
Date: | 2018-06-29 14:51:56 |
Message-ID: | 3bbdd1ee-544d-a549-b0c2-30485d9f6a16@sigaev.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>> I tried to attack the cost_sort() issues and hope on that basis we can solve
>> problems with 0002 patch and improve incremental sort patch.
>>
>
> OK, will do. Thanks for working on this!
I hope, now we have a better cost_sort(). The obvious way is a try all
combination of pathkeys in get_cheapest_group_keys_order() and choose cheapest
one by cost_sort(). But it requires N! operations and potentially could be very
expensive in case of large number of pathkeys and doesn't solve the issue with
user-knows-what-he-does pathkeys. We could suggest an order of pathkeys as patch
suggests now and if cost_sort() estimates cost is less than 80% (arbitrary
chosen) cost of user-suggested pathkeys then it use our else user pathkeys.
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2018-06-29 15:03:13 | Re: POC: GROUP BY optimization |
Previous Message | Tomas Vondra | 2018-06-29 14:50:47 | Re: ERROR: cannot start subtransactions during a parallel operation |