Re: Performance issue with NestedLoop query

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: Performance issue with NestedLoop query
Дата
Msg-id CAJjS0u30tchMJdEgExZBqeJkdXXtgBwbn5Uvi17zWwNkvjF7TA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Performance issue with NestedLoop query  (Ram N <yramiyer@gmail.com>)
Список pgsql-performance
On Tue, Aug 4, 2015 at 8:40 PM, Ram N <yramiyer@gmail.com> wrote:
>
> Thanks much for responding guys. I have tried both, building multi column
> indexes and GIST, with no improvement. I have reduced the window from 180
> days to 30 days and below are the numbers
>
> Composite index -  takes 30 secs
>
> With Btree indexing  - takes 9 secs
>
> With GIST - takes >30 secs with kind of materialize plan in explain
>
> Any other ideas I can do for window based joins.
>

From this query:

select sum(a), count(id), a.ts, st from table1 a, table2 b where a.ts
> b.start_date and a.ts < b.end_date and a.ts > '2015-01-01
20:50:44.000000 +00:00:00' and a.ts < '2015-07-01 19:50:44.000000
+00:00:00' group by a.ts, st order by a.ts

We can actually derive that b.start_date > '2015-07-01 19:50:44.000000
+00:00:00' and b.end_date < '2015-01-01 20:50:44.000000 +00:00:00'. If
we add these two predicates to the original query, does it help?

Thanks,
Qingqing


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

Предыдущее
От: Ram N
Дата:
Сообщение: Re: Performance issue with NestedLoop query
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: Slow HashAggregate/cache access