Re: Using GROUPING SETS with more than one set disables predicate pushdown?
От | Tom Lane |
---|---|
Тема | Re: Using GROUPING SETS with more than one set disables predicate pushdown? |
Дата | |
Msg-id | 1703.1511275766@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Using GROUPING SETS with more than one set disables predicate pushdown? (Zakhar Shapurau <zak@zvs.no>) |
Ответы |
Re: Using GROUPING SETS with more than one set disables predicate pushdown?
Re: Using GROUPING SETS with more than one set disables predicate pushdown? |
Список | pgsql-performance |
Zakhar Shapurau <zak@zvs.no> writes: > Using GROUPING SETS with more than one set disables predicate pushdown? It looks like this is a case that no one's gotten round to yet. The comment in the relevant code is * In some cases we may want to transfer a HAVING clause into WHERE. We * cannot do so if the HAVING clause containsaggregates (obviously) or * volatile functions (since a HAVING clause is supposed to be executed * only onceper group). We also can't do this if there are any nonempty * grouping sets; moving such a clause into WHERE wouldpotentially change * the results, if any referenced column isn't present in all the grouping * sets. (If thereare only empty grouping sets, then the HAVING clause * must be degenerate as discussed below.) Presumably, we could examine the grouping sets to identify column(s) present in all sets, and then allow the optimization for clauses that reference only such columns. Or maybe I'm misreading the comment (but then it needs clarification). regards, tom lane
В списке pgsql-performance по дате отправления: