Re: [GENERAL] Join query help

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: [GENERAL] Join query help
Дата
Msg-id 311DDC69-7101-4591-99EC-8FFF4365C53B@seespotcode.net
обсуждение исходный текст
Ответ на Re: [GENERAL] Join query help  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-sql
On Aug 20, 2007, at 20:27 , Michael Glaesemann wrote:

> Note: record_id is in integer, yet you're quoting the value ('1').
> This causes the server to cast the text value to an integer. Here
> it's not going to cause much of a problem, just a couple CPU
> cycles. In table definitions (and possibly queries?) it can cause
> the server to ignore otherwise usable indexes when planning
> queries. (I see below your other inserts also quote integer values:
> you should drop the quotes there as well.)

Some clarification: what I meant by "table definitions" is if you're
actually defining text columns that reference integer columns. For
example:

CREATE TABLE foos (foo_id INTEGER PRIMARY KEY, foo text NOT NULL
UNIQUE);
CREATE TABLE bars (bar text PRIMARY KEY, foo_id text NOT NULL
REFERENCES foos (foo_id));

Michael Glaesemann
grzm seespotcode net



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

Предыдущее
От: novice
Дата:
Сообщение: Re: [GENERAL] Join query help
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: [GENERAL] Join query help