pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vellinga, Fred <fred.vellinga@nl.verizonbusiness.com>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Special meaning of NL string
Date: Tue, 4 Apr 2006 09:40:12 +0100
Message-ID: <DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com> (raw)

			
		

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
 
 

view thread (3+ messages)  latest in thread

Message-ID: <DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com>
Permalink:  ../DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com/
Also on:    postgresql.org/message-id/DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fred.vellinga@nl.verizonbusiness.com
  Subject: Re: Special meaning of NL string
  In-Reply-To: <DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox