SV: force partition pruning

From: Niels Jespersen <NJN(at)dst(dot)dk>
To: Vijaykumar Jain <vijaykumarjain(dot)github(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: SV: force partition pruning
Date: 2021-05-11 12:14:00
Message-ID: e5394e430cd74d3199437dc20d944c81@dst.dk
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
>Sorry,
>
>I made a major mistake. I somehow saw the period and period_version as the same.
>so, yes partitions are not pruned here. So my suggestion makes no sense.

Thats quite ok. I think my plan now is to have a table returning function that executes a query dynamically. The query has a where caluse that is first constructed.

Like this:

return query execute format('select d.x, d.y from %1$I.%1$I d where d.period_version = any(' || quote_literal(_periode_version_array) ||'::text[])', register_in);

Regards Niels

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Sumner 2021-05-11 15:54:39 Sequence gaps after restart
Previous Message Vijaykumar Jain 2021-05-11 11:51:03 Re: force partition pruning