Help with list partitioning on expression

From: Dinko Papak <rimokatolik(at)outlook(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Help with list partitioning on expression
Date: 2018-10-18 13:49:52
Message-ID: CY4PR0101MB3175ED688D32367B25A237F0BAF80@CY4PR0101MB3175.prod.exchangelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have created table partitioned by list on expression using timestamp column, so for each timestamp value function returns int and each partition table is for single value (range of timestamp for which function result is the same). This helps me to simplify querying as I do not need to always write date ranges. Querying (partition pruning) works nice, however when I attach new partition it seems to always scan whole table, although I do have necessary check constraint on partitioned table. I have tried to make timestamp column both null and not null. Also, it takes longer to attach partition then to add constraint itself although per my understanding those 2 operations should do the same scan.

Thank you,
Dinko

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fabio Pardi 2018-10-18 14:15:05 Re: Pgbouncer discard all
Previous Message Jehan-Guillaume (ioguix) de Rorthais 2018-10-18 13:45:04 Re: BUG: Incorrect working with POSIX locale if database in UTF-8 encoding