Search Postgresql Archives

Re: Use case stuck due to Partitioning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx> 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?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux