Re: Proposition for better performance

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: hmidi slim
Дата:
Сообщение: Re: Proposition for better performance
Следующее
От: Ken Beck
Дата:
Сообщение: Postgresql 9.3 Server will not start after Ubuntu Upgrade