Re: Use case stuck due to Partitioning

Поиск
Список
Период
Сортировка
От Shubham Mittal
Тема Re: Use case stuck due to Partitioning
Дата
Msg-id CA+ERcR_QnczY013J-68i3av4tK2PkQevyPE2-T+AKCWUOt83DA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use case stuck due to Partitioning  (Michael Lewis <mlewis@entrata.com>)
Ответы Re: Use case stuck due to Partitioning  (Michael Lewis <mlewis@entrata.com>)
Список 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@entrata.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?

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Lewis
Дата:
Сообщение: Re: Use case stuck due to Partitioning
Следующее
От: Ron
Дата:
Сообщение: ALTER TABLE ... DETACH PARTITION just sitting there