Special meaning of NL string - Mailing list pgsql-sql

From Vellinga, Fred
Subject Special meaning of NL string
Date
Msg-id DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com
Whole thread Raw
Responses Re: Special meaning of NL string  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
 
 

pgsql-sql by date:

Previous
From: dave.bath@unix.net
Date:
Subject: global variables in plpgsql?
Next
From: "Jure Kodzoman (Dhimahi)"
Date:
Subject: GROUP BY issue