On Sat, 8 Nov 2003, ow wrote:

> Postgresql 7.4.rc1 on i686 pc linux compiled by gcc 2.06.
> All configuration settings are default.
>
>
> Hi,
>
> Trying to find a way to improve range query performance.
>
> The table Test has about 30 million records.
>
> -- DLong, Dtimestamp, Dint, etc are domains of the respective types.
> create table Test (
> id              DLong               not null,
> a               Dtimestamp              null,
> b               Dint                not null,
> c               Dint                not null,
> d               Dstring                 null,
> constraint PK_id primary key (id),
> constraint AK_abc unique (a, b, c)
> );

I'm not sure that AK_abc is the best index for check a range on a and
single values on b and c.  I'd think that something like an index
on (b,c,a) would probably be better for this purpose (without doing any
testing ;) ).

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to