Re: Bad plan on a huge table query

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Bad plan on a huge table query
Дата
Msg-id CAMkU=1yRdK47wGEEnQ2O1n62VMmMtC__vPSB+Frgxk5uFBLBhg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bad plan on a huge table query  (Daniel Cristian Cruz <danielcristian@gmail.com>)
Список pgsql-general
On Thu, Mar 21, 2013 at 10:53 AM, Daniel Cristian Cruz <danielcristian@gmail.com> wrote:
And now, it runs, at least:


No one could send a guess on it?

Without showing either the query, or the definition of the tables, you are not giving us much to go on.

I'm particularly interested in what inicio is and what idx_aula_confirmacao_2 is.  If inicio is already a date, why is being cast to date?  And if it is not already a date, how can it be used in the index scan?



        ->  Index Scan using idx_aula_confirmacao_2 on aula_confirmacao  (cost=0.01..7582.88 rows=4442 width=24) (actual time=64.017..81747.794 rows=101508 loops=1)"
                          Index Cond: (((inicio)::date >= date_trunc('YEAR'::text, now())) AND ((inicio)::date <= now()))"

 Cheers,

Jeff

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

Предыдущее
От: Roberto Scattini
Дата:
Сообщение: Re: streaming replication question
Следующее
От: Daniel Cristian Cruz
Дата:
Сообщение: Re: Bad plan on a huge table query