Re: Using indices with long unique IDs.

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Using indices with long unique IDs.
Дата
Msg-id 20040109122524.GA16604@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: Using indices with long unique IDs.  ("D. Dante Lorenso" <dante@lorenso.com>)
Список pgsql-general
On Fri, Jan 09, 2004 at 04:11:08AM -0600, D. Dante Lorenso wrote:
> Sergey Olefir wrote:
>
> >So the logical choice would be int8, right? Unfortunately quite wrong.
> >Statement of the form: "SELECT * FROM table WHERE id=1"
> >will never use index for id (assumming id is int8) since '1' is of type
> >int4. This is confirmed both by documentation and SQL EXPLAIN (after set
> >enable_seqscan TO 'off').

I think you can use WHERE id=cast(1 AS bigint)


> Well, that just plain sucks.  That means I've gotta go back and
> add casts to all my queries?
>
> Tell me it isn't so!

Yeah, it is :-(  AFAIU it is fixed in the current development version,
but who knows if it will be done in time before you tables grow too big ...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Porque francamente, si para saber manejarse a uno mismo hubiera que
rendir examen... ¿Quién es el machito que tendría carnet?"  (Mafalda)

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

Предыдущее
От: "D. Dante Lorenso"
Дата:
Сообщение: Re: Using indices with long unique IDs.
Следующее
От: David Helgason
Дата:
Сообщение: array faults?