Re: [HACKERS] Neverending query on 6.5.2 over Solaris 2.5.1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Neverending query on 6.5.2 over Solaris 2.5.1
Дата
Msg-id 20995.940612509@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Neverending query on 6.5.2 over Solaris 2.5.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Neverending query on 6.5.2 over Solaris 2.5.1
Список pgsql-hackers
I wrote:
> Weird.  I assume that your 'activa' field is 'bool'?  I've been trying
> to duplicate this misbehavior here, and as near as I can tell the system
> handles selectivity estimates for boolean fields just fine.  Whatever
> percentage of 't' values was seen by the last VACUUM ANALYZE is exactly
> what it uses.

On second thought: 6.5.* can get confused if the column contains more
NULLs than anything else.  Dunno if you have a lot of nulls in activa,
but if so you might try changing them all to explicit 'f' and then
redoing the VACUUM ANALYZE.  Next release will be smarter about keeping
stats in the presence of many nulls.

It'd be useful to double-check my theory that the system is
misestimating the selectivity of the WHERE (u.activa) clause.
You could try this:SELECT count(*) FROM usarios WHERE activa;EXPLAIN SELECT count(*) FROM usarios WHERE activa;
and see how far off the row count estimate in the EXPLAIN is
from reality.
        regards, tom lane


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

Предыдущее
От: Peter Mount
Дата:
Сообщение: Re: [HACKERS] GPL vs BSD licencing - a new twist
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: Planning final assault on query length limits