Scalar in a range (but textual not numeric)

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Scalar in a range (but textual not numeric)
Дата
Msg-id 200402251918.20289.dev@archonet.com
обсуждение исходный текст
Ответы Re: Scalar in a range (but textual not numeric)  (Richard Huxton <dev@archonet.com>)
Re: Scalar in a range (but textual not numeric)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Scalar in a range (but textual not numeric)  (Edmund Bacon <ebacon@onesystem.com>)
Список pgsql-sql
Large table representing non-overlapping blocks:

blocks(id int4, min varchar, max varchar)

SELECT * FROM blocks WHERE 'ABCDE' BETWEEN min AND max;

The estimator gets the wrong plan because it doesn't realise there's (at most) 
only one block that can match.

Can't use any of the geometry related types since we've got text here not 
numbers. Nothing in the archives seems quite right (AFAICT).

Any smart ideas? I'm happy to trade time when updating the blocks table 
against lookup speed.

--  Richard Huxton Archonet Ltd


В списке pgsql-sql по дате отправления:

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: [PERFORM] [HACKERS] Materialized View Summary
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Scalar in a range (but textual not numeric)