Re: pg12 - partition by column that might have null values - Mailing list pgsql-performance

From Mariel Cherkassky
Subject Re: pg12 - partition by column that might have null values
Date
Msg-id CA+t6e1mLdjA=PF6PO5HY3XoNPwOeHjb3OVY4QRZ5U5iiy-faVA@mail.gmail.com
Whole thread Raw
In response to RE: pg12 - partition by column that might have null values  ("Mike Sofen" <msofen@runbox.com>)
Responses RE: pg12 - partition by column that might have null values  ("Mike Sofen" <msofen@runbox.com>)
List pgsql-performance
but the start time doesnt indicates that the object is the most recent, it just indicates when the object was added to your table. If your queries involve the start_time I can understand why u set it as a partition column, otherwise is isnt useful. In most of my queries I query by one of 2 options :
1.Where end_time is null 
2.Where start_date>DATE and end_date <DATE

I think that doing the following will be the best option : 
partition by list (end_time) -  (1 for all non null (non infinity) and 1 default for all those who has end_time that isnt null)
on each partition I'll create range partition on the end_date so that I can search for revisions faster.

What do you think ? 

pgsql-performance by date:

Previous
From: "Mike Sofen"
Date:
Subject: RE: pg12 - partition by column that might have null values
Next
From: "Mike Sofen"
Date:
Subject: RE: pg12 - partition by column that might have null values