Re: Proposition for better performance

Поиск
Список
Период
Сортировка
От hmidi slim
Тема Re: Proposition for better performance
Дата
Msg-id CAMsqVxtRD5dCVL3o_eCWNdwo4igQCzjMgXTdD+sDVD8AHHkgDg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposition for better performance  (Paul Jungwirth <pj@illuminatedcomputing.com>)
Ответы Re: Proposition for better performance
Список pgsql-general
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);

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.Thtat's why I asked if it is a good solution to divide the availability of a product by intervals.
If I assume that a product has in every month 5 availability intervals, in 12 months we will have 60 intervals.For 1M products that's will be 60M rows. This will affect the performance.

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

Предыдущее
От: Steve Rogerson
Дата:
Сообщение: Re: Check constraints.
Следующее
От: Paul Jungwirth
Дата:
Сообщение: Re: Proposition for better performance