Special meaning of NL string

From: "Vellinga, Fred" <fred(dot)vellinga(at)nl(dot)verizonbusiness(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Special meaning of NL string
Date: 2006-04-04 08:40:12
Message-ID: DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hello,

I wonder if there is an issue with the string 'NL'. In my application NL
stands for Netherlands and is thus a country code abreviation.

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. If I replace OR by
AND it also does an index scan. So apparently the string NL in the OR Where
clause decides the query planner not to execute an index scan. The database
encoding schema is SQL_ASCII.

Thanks,
Fred Vellinga


Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Eugene E. 2006-04-04 10:30:14 Re: have you feel anything when you read this ?
Previous Message Bryce Nesbitt 2006-04-03 21:58:52 Re: group by function, make SQL cleaner?