Re: different query plan because different limit # (Re: [PERFORM] weird query plan)

2007-06-06 Thread weiping
continue digging shows: set cpu_tuple_cost to 0.1; explain analyze select * from wd_urlusermaps where share =1 and userid='219177' order by id desc limit 20; SET 时间: 0.256 ms QUERY PLAN -

different query plan because different limit # (Re: [PERFORM] weird query plan)

2007-06-06 Thread weiping
I changed the query to : EXPLAIN ANALYZE select id from wd_urlusermaps where id in (select id from wd_urlusermaps where share =1 and userid='219177') order by id desc limit 20; and it's much better now (from real execute time), but the cost report higher then slower one above, may be I should do s

Re: [PERFORM] weird query plan

2007-06-05 Thread weiping
sorry, forgot to mention our version, it's postgresql 8.2.3 -laser > I have a table: > webdigest=# \d wd_urlusermaps > 表 "public.wd_urlusermaps" > 字段名 | 类型 | 修饰词 > -+-+- > id | integer | not null defaul

[PERFORM] weird query plan

2007-06-05 Thread weiping
I have a table: webdigest=# \d wd_urlusermaps 表 "public.wd_urlusermaps" 字段名 | 类型 | 修饰词 -+-+- id | integer | not null default nextval('wd_urlusermaps_id_seq'::regclass) urlid | integer | not null tag | ch