From: | "Vellinga, Fred" <fred(dot)vellinga(at)nl(dot)verizonbusiness(dot)com> |
---|---|
To: | 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Special meaning of NL string |
Date: | 2006-04-13 06:23:56 |
Message-ID: | DB8373C85B90D71191350008C784C7390306AF84@ms-ams-exch02.nl.mcilink.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)sss(dot)pgh(dot)pa(dot)us]
Sent: 11 April 2006 04:58
To: Vellinga, Fred
Cc: 'pgsql-sql(at)postgresql(dot)org'
Subject: Re: [SQL] Special meaning of NL string
"Vellinga, Fred" <fred(dot)vellinga(at)nl(dot)verizonbusiness(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | ivan marchesini | 2006-04-13 13:18:10 | how to solve this problem |
Previous Message | Gregory S. Williamson | 2006-04-13 02:43:00 | Truncate and Foreign Key References question |