Re: pg12 - partition by column that might have null values

From: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>
To: Mike Sofen <msofen(at)runbox(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: pg12 - partition by column that might have null values
Date: 2019-10-02 13:44:31
Message-ID: CA+t6e1mLdjA=PF6PO5HY3XoNPwOeHjb3OVY4QRZ5U5iiy-faVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 ?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mike Sofen 2019-10-02 23:14:22 RE: pg12 - partition by column that might have null values
Previous Message Mike Sofen 2019-10-02 12:08:05 RE: pg12 - partition by column that might have null values