Re: Bad performance of SELECT ... where id IN (...) - Mailing list pgsql-performance

From Xia Qingran
Subject Re: Bad performance of SELECT ... where id IN (...)
Date
Msg-id b5ff60410909262313s134bd152v414a7d55a825f53e@mail.gmail.com
Whole thread Raw
In response to Re: Bad performance of SELECT ... where id IN (...)  (Craig James <craig_james@emolecules.com>)
Responses Re: Bad performance of SELECT ... where id IN (...)
List pgsql-performance
On Sat, Sep 26, 2009 at 10:59 PM, Craig James
<craig_james@emolecules.com> wrote:
>
> If your user_id is always in a narrow range like this, or even in any range
> that is a small fraction of the total, then add a range condition, like
> this:
>
> select * from event where user_id <= 500 and user_id >= 0 and user_id in
> (...)
>
> I did this exact same thing in my application and it worked well.
>
> Craig
>

It is a good idea. But In my application, most of the queries' user_id
are random and difficult to range.
Thanks anyway.



--
夏清然
Xia Qingran
qingran.xia@gmail.com
Sent from Beijing, 11, China
Charles de Gaulle  - "The better I get to know men, the more I find
myself loving dogs." -
http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html

pgsql-performance by date:

Previous
From: Xia Qingran
Date:
Subject: Re: Bad performance of SELECT ... where id IN (...)
Next
From: Gerhard Wiesinger
Date:
Subject: Re: Many left outer joins with limit performance