Re: Slow query and indexes... - Mailing list pgsql-general

From Jim Nasby
Subject Re: Slow query and indexes...
Date
Msg-id 184EB9E2-3F5E-482E-BC15-EE246D6DF055@decibel.org
Whole thread Raw
In response to Re: Slow query and indexes...  (PFC <lists@peufeu.com>)
List 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 by date:

Previous
From: "Andreas Schultz"
Date:
Subject: SELECT TIMESTAMP WITH TIME ZONE ... AT TIME ZOME as inverted meaning with UTC times...
Next
From: Jim Nasby
Date:
Subject: Re: Slow query and indexes...