Re:

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Дмитрий Воронин <carriingfate92(at)yandex(dot)ru>
Cc: Steve Midgley <science(at)misuse(dot)org>, "pgsql-sql(at)lists(dot)postgresql(dot)org" <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re:
Date: 2022-02-02 05:47:11
Message-ID: CAKFQuwaOjOV3XS0XVpS6u1LSPcVTG6Oj_i_5hKLnm00a2ime_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, February 1, 2022, Дмитрий Воронин <carriingfate92(at)yandex(dot)ru>
wrote:
>
>
> ...
> "dates": ["2019-10-02", "2018-02-03"]
> ...
>
> So, I want to SELECT all docids, which dates in range:
>
>
>
> So, searching on dates field will be often and I want speed up by indexing
> but I don't known how.
>

Create a generated column of type daterange and populate that on
insert/update. Index that column. Write queries against that column. (Not
tested, but in short get rid of the json pseudo daterange array
implementation and use the real SQL daterange type)

David J.

In response to

  • Re: at 2022-02-02 05:38:18 from Дмитрий Воронин

Browse pgsql-sql by date

  From Date Subject
Next Message aditya desai 2022-02-03 11:38:17 Re: How can i pass variable in dblink_connect_u ?
Previous Message Дмитрий Воронин 2022-02-02 05:38:18 Re: