From: | Shubham Mittal <mittalshubham30(at)gmail(dot)com> |
---|---|
To: | Michael Lewis <mlewis(at)entrata(dot)com> |
Cc: | PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Use case stuck due to Partitioning |
Date: | 2021-06-28 20:09:34 |
Message-ID: | CA+ERcR_QnczY013J-68i3av4tK2PkQevyPE2-T+AKCWUOt83DA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi Michael,
Yes I have a btree index on the *modified_date* column currently.
SELECT * FROM partitioned_table where
A ='Value'
AND created_date >= '2021-03-01 08:16:13.589' and created_date <=
'2021-04-02 08:16:13.589' ORDER BY viewpriority desc OFFSET 0 ROWS FETCH
NEXT 200 ROWS ONLY;
Here viewpriority is basically a long value containing created_date in
milliseconds.
Issue here is : I want to somehow include *modified_date also in this
query to get the records sorted by **modified_date . But that sorting will
happen only in the specified created_date range only. I want those latest
modified records also whose created_date might not lie in this range.*
*Thanks *
On Tue, Jun 29, 2021 at 1:22 AM Michael Lewis <mlewis(at)entrata(dot)com> wrote:
> Do you have an index on the "updated_at" field and found that the query is
> too slow? Do you have an example query?
>
From | Date | Subject | |
---|---|---|---|
Next Message | Ron | 2021-06-28 21:08:17 | ALTER TABLE ... DETACH PARTITION just sitting there |
Previous Message | Michael Lewis | 2021-06-28 19:51:49 | Re: Use case stuck due to Partitioning |