Re: [GENERAL] Expensive query - Mailing list pgsql-general

From Christophe Pettus
Subject Re: [GENERAL] Expensive query
Date
Msg-id 4.1.19981030151737.00a1c920@exchange.postdirect.com
Whole thread Raw
In response to Expensive query  (Christophe Pettus <pettus@postdirect.com>)
Responses Re: [GENERAL] Expensive query
List pgsql-general
At 02:13 PM 10/30/98 , you wrote:
>    That users table looks kinda useless.  I'd recommend changing id
>to name and making id an int, then putting your events users in as ints.
>Currently, it doesn't do anything at all, and you might as well be doing
>this query [...]

Actually, the real-life 'users' table has lots of fields, none of them
relevant to the question at hand.

>    I would also recommend not making code a char(10).  If you put an
>index on code and an index on date, you should be able to get your results
>pretty quick.

They are indexed.

Using ints is not unreasonable, but does not explain the pathological behavior.

pgsql-general by date:

Previous
From: Adam Miller
Date:
Subject: thrashing like a beached shark
Next
From: Mike Meyer
Date:
Subject: Re: [GENERAL] Problem with aggregates and group by