improving windows functions performance

Поиск
Список
Период
Сортировка
От Mariel Cherkassky
Тема improving windows functions performance
Дата
Msg-id CA+t6e1ntypz5mLaR-5g_EKJKn0LKwzkjNHKb32ZyEDr1CYSJ9Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: improving windows functions performance
Список pgsql-performance
Hey,
I have a very big query that consist from 3-4 subqueries that use windows functions. There is a chance that I'll need to rewrite the query but first I'm trying to search for other ways to improve it and I'll be happy to hear if one of u have an idea.

Basically my table has the following structure : (objid,first_num,last_num) and each record is a range from the first number to the last one for that specific obj. I'm trying to unite ranges that overlaps. For example : 
for the following table : 
objid first_num last_num
1          5                7
1          8                 10
2          4                   6
2          9                   10

I would like to get : 
objid first_num last_num
1          5                10
2          4                   6
2          9                   10 

I have a query that does it but takes about 4s for 1.5M records. I created an index on (objid,first_num,last_num) in order to use only index scan instead of seq scan on this table. I wanted to here if u guys have any other ideas.

Thanks. 

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Strange runtime partition pruning behaviour with 11.4
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: improving windows functions performance