Re: postgres_fdw aggregate pushdown for group by with expressions

From: Michał Kłeczek <michal(at)kleczek(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres_fdw aggregate pushdown for group by with expressions
Date: 2024-03-04 07:09:26
Message-ID: F580DABA-5F1B-4F0D-9506-3DBE0EB92D24@kleczek.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 4 Mar 2024, at 07:46, Michał Kłeczek <michal(at)kleczek(dot)org> wrote:
>
>
>
>> On 3 Mar 2024, at 18:42, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> =?utf-8?Q?Micha=C5=82_K=C5=82eczek?= <michal(at)kleczek(dot)org> writes:
>>> I’ve performed some more tests and it seems expressions with “extract” function are not pushed down at all -
>>
>> Yeah :-(. I traced through this, and it seems it's a collation
>> problem. Internally, that call looks like
>> extract('year'::text, date_column)
>> The text constant is marked as having collation "default", which means
>> that extract() is marked as having input collation "default", and then
>> it falls foul of this rule:
> [snip]
>
> Thanks for explanation - I have a follow-up question.
>
> Does that mean that *any* expression containing text constants is not going to be pushed down??
> That would be a really serious issues I’d say.

I’m afraid it is affecting all expressions containing functions.
This is really troublesome as it blocks push down for some basic (and collation independent) functions like coalesce.


Michal

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2024-03-04 08:40:34 Re: When manual analyze is needed
Previous Message Michał Kłeczek 2024-03-04 06:46:33 Re: postgres_fdw aggregate pushdown for group by with expressions