Re: Special meaning of NL string

Поиск
Список
Период
Сортировка
Искать
От
Vellinga, Fred
Тема
Re: Special meaning of NL string
Дата
Msg-id
DB8373C85B90D71191350008C784C7390306AF84@ms-ams-exch02.nl.mcilink.com
Список
Дерево обсуждения
Re: Special meaning of NL string "Vellinga, Fred" <fred.vellinga@nl.verizonbusiness.com>

Tom,

Thanks for your answer. The problem is indeed related to the statistics.
The isssue now seems to find out why the statistics are 'incorrect' every day.
My gues is the following: we run every night the command VACUUM ANALYZE. This command return wrong statistics info. Because when I run ANALYZE only on a table, everything is fine.

We are on PosgreSQL 7.4.

Groet,
Fred Vellinga

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: 11 April 2006 04:58
To: Vellinga, Fred
Cc: 'pgsql-sql@postgresql.org'
Subject: Re: [SQL] Special meaning of NL string

"Vellinga, Fred" <fred.vellinga@nl.verizonbusiness.com> writes:
> The query
> SELECT COUNT(*) FROM Table WHERE Field1 = 'NL' OR Field2 = 'NL' does a
> sequence scan instead of an index scan, and is thus very slow. If I
> replace NL by BE (Belgium) the query does an index scan.

Probably, 'NL' is a lot more common than 'BE' in your table ... the planner does examine statistics while deciding what sort of scan to use.

                        regards, tom lane

В списке pgsql-sql по дате отправления
От: kevin@kevinkempterllc.com
Дата:
От: Bruno Wolff III
Дата:
Сообщение: Re: Please help with a query..
FAQ