Re: Speed up the query

Поиск
Список
Период
Сортировка
Искать
От
Andreas Kretschmer
Тема
Re: Speed up the query
Дата
Msg-id
20131201071231.GA4780@tux
Ответ на
Speed up the query (Hengky Liwandouw)
Список
Дерево обсуждения
Speed up the query Hengky Liwandouw <hengkyliwandouw@gmail.com>
Re: Speed up the query Kevin Grittner <kgrittn@ymail.com>
Re: Speed up the query Hengky Lie <hengkyliwandouw@gmail.com>
Re: Speed up the query Andreas Kretschmer <akretschmer@spamfence.net>
Re: Speed up the query Hengky Liwandouw <hengkyliwandouw@gmail.com>
Hengky Liwandouw  wrote:
> 
> But the problem is : when i change the where clause to :
> 
> where jualid is not null or returjualid is not null
> and extract(year from tanggal)='2013')

Try to create this index:

create index xxx on public.tbltransaksi((extract(year from tanggal)))
where jualid is not null or returjualid is not null;

an run the query again, and if this not helps show us explain analyse,
you can use explain.depesz.com to provide us the plan.


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

В списке pgsql-performance по дате отправления
От: Hengky Liwandouw
Дата:
Сообщение: Speed up the query
От: Hengky Liwandouw
Дата:
Сообщение: Re: Speed up the query
FAQ