Re: Query analyse

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Query analyse
Дата
Msg-id 20030725084243.U31713-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Query analyse  (Elielson Fontanezi <ElielsonF@prodam.sp.gov.br>)
Ответы Re: Query analyse  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, 25 Jul 2003, Elielson Fontanezi wrote:

>     First of all, my envoronment is:
>         Linux netlab142.prodam 2.4.8-26mdk #1 Sun Sep 23 17:06:39 CEST 2001
> i686 unknown
>         pg_ctl (PostgreSQL) 7.2.1
>
>     I would like some suggestions on how to speed up a query.
>
>     Both of the queries below are identical except that one of them use the
> trunc function.
>
>     You can see that the TRUNC function rise hardly up the query response
> time in the second query.
>     That shouldn�t be happen. Only because a trunc function?
>
>     What can I be in that case?
>     What does it happen?

What does explain show for the two queries and what are the table schemas?
You're probably ending up with different plans since in one case it has
a plain column reference and in the other it has a marginally complicated
expression in the join condition.

As something to try, perhaps make a function that returns
trunc($1/100000.0)*100000 and index on that function for the column and
see if that changes the plan you get.




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

Предыдущее
От: "Cory 'G' Watson"
Дата:
Сообщение: Re: Solaris, Postgresql and Problems
Следующее
От: Dmitry Tkach
Дата:
Сообщение: Re: Query analyse