Re: [PERFORM] Bad performance of SELECT ... where id IN (...)

2009-10-09 Thread Xia Qingran
patch helps speed things up > 10x over here. Thanks! I am trying it. Regards, Xia Qingran > > Regards, > Omar > > On Sun, Sep 27, 2009 at 5:13 PM, Xia Qingran wrote: >> On Sat, Sep 26, 2009 at 10:59 PM, Craig James >> wrote: >>> >>> If your user_

Re: [PERFORM] Bad performance of SELECT ... where id IN (...)

2009-09-26 Thread Xia Qingran
d >= 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@gmail.com

Re: [PERFORM] Bad performance of SELECT ... where id IN (...)

2009-09-26 Thread Xia Qingran
On Sun, Sep 27, 2009 at 1:03 AM, Tom Lane wrote: > Xia Qingran writes: >> I have a big performance problem in my SQL select query: >> select * from event where user_id in >> (500,499,498, ... ,1,0); >> The above SELECT always spends 1200ms. > > Your EXPLAIN ANAL

[PERFORM] Bad performance of SELECT ... where id IN (...)

2009-09-26 Thread Xia Qingran
sn integer, created_date timestamp with time zone NOT NULL ); = And the table event has more than 100,000,000 rows, and I have a btree index, event_user_id_idx, on user_id, the index size is 2171MB. Do anyone have good ideas to optimize this query? Thanks very much. -- 夏清然 Xia Q