Re: Trimming the cost of ORDER BY in a simple query

From: Harald Fuchs <use_reply_to(at)protecting(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Trimming the cost of ORDER BY in a simple query
Date: 2005-05-03 10:59:48
Message-ID: puu0lk60d7.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

In article <1115104938(dot)5853(dot)25(dot)camel(at)localhost(dot)localdomain>,
Ragnar Hafstað <gnari(at)simnet(dot)is> writes:

> 20 ms does not sound like a big problem.

> if 20 ms is really too much for you, and add_date IS a timestamp,
> you might think about adding a date column , maintained
> by triggers of by your application, and add an index on (user_id, x)

Maybe a functional index on "date_trunc('day', add_date)" would be helpful?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ramakrishnan Muralidharan 2005-05-03 11:49:00 Re: Function or Field?
Previous Message Ezequiel Tolnay 2005-05-03 08:08:23 Re: Trimming the cost of ORDER BY in a simple query