Special meaning of NL string

Поиск
Список
Период
Сортировка
От Vellinga, Fred
Тема Special meaning of NL string
Дата
Msg-id DB8373C85B90D71191350008C784C7390306AF67@ms-ams-exch02.nl.mcilink.com
обсуждение исходный текст
Ответы Re: Special meaning of NL string  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: dave.bath@unix.net
Дата:
Сообщение: global variables in plpgsql?
Следующее
От: "Jure Kodzoman (Dhimahi)"
Дата:
Сообщение: GROUP BY issue