| От | Paul Jungwirth |
|---|---|
| Тема | Re: Proposition for better performance |
| Дата | |
| Msg-id | 834d8a70-386d-7101-f846-ae572140af92@illuminatedcomputing.com обсуждение |
| Ответ на | Re: Proposition for better performance (hmidi slim <hmidi.slim2@gmail.com>) |
| Список | pgsql-general |
On 03/27/2018 10:04 AM, hmidi slim wrote:
> the query that I used to fetch products was:
> select * from availability
> where ('27-03-2018' between start_date and end_date)
> and ('31-03-2018' between start_date and end_date);
>
> I added another column named during of type daterange and I created a
> gist index :
> create index idx on availability(during);
That creates a b-tree index.
Also, what did you set `during` to?
> select * from availability
> where during @> daterange(''27-03-2018', '31-03-2018');
>
> With a table of 15M rows I got an execution time of 1 minute.
What was the query plan? Did you confirm that it used the index?
--
Paul ~{:-)
pj@illuminatedcomputing.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера