Re: Slow query and indexes...

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Slow query and indexes...
Дата
Msg-id 184EB9E2-3F5E-482E-BC15-EE246D6DF055@decibel.org
обсуждение исходный текст
Ответ на Re: Slow query and indexes...  (PFC <lists@peufeu.com>)
Список pgsql-general
On May 8, 2007, at 3:29 AM, PFC wrote:
> Create a table which contains your list of loggers (since it's good
> normalization anyway, you probably have it already) and have your
> data table's logger_id REFERENCE it

BTW, you could do that dynamically with a subselect: (SELECT DISTINCT
logger_id FROM data) AS loggers, though I'm not sure how optimal the
plan would be.

BTW, I encourage you to not use 'id' as a field name; I've found it
makes doing things like joins a lot trickier. Easier to just make
every id field the same (logger_id in this case).
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



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

Предыдущее
От: "Andreas Schultz"
Дата:
Сообщение: SELECT TIMESTAMP WITH TIME ZONE ... AT TIME ZOME as inverted meaning with UTC times...
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: Slow query and indexes...