Re: [PERFORM] Planner doesn't take indexes into account

2014-05-28 Thread Grzegorz Olszewski
OK, thank you very much. I've tried similar query but with very few rows matching. In this case index was present in the plan. BR, Grzegorz Olszewski > Date: Wed, 28 May 2014 08:31:38 -0500 > From: stho...@optionshouse.com > To: grzegorz.olszew...@outlook.com; rumman...@gmail.c

Re: [PERFORM] Planner doesn't take indexes into account

2014-05-28 Thread Grzegorz Olszewski
random_page_cost = 4.0 seq_page_cost = 1.0 There is about 500,000 rows and about 500 new rows each business day. About 96% of rows meet given conditions, that is, count shoud be about 480,000. BR, Grzegorz Olszewski Date: Tue, 27 May 2014 14:14:21 -0700 Subject: Re: [PERFORM] Planner doesn&#

[PERFORM] Planner doesn't take indexes into account

2014-05-27 Thread Grzegorz Olszewski
((moderation_status)::text <> 'DANGEROUS'::text))) I don't understand why planner doesn't use indexes. The problem is there are about 0.5M rows satisfying condition (almost every row in the table). Could you please explain this behavior? I'm using PostgreSQL 9.2.8 on Ubuntu 12.04 LTS x86_64 Best regards, Grzegorz Olszewski