[PERFORM] Seq scan over 3.3 millions of rows instead of using date and pattern indexes

2008-11-30 Thread Andrus
explain analyze SELECT sum(1) FROM dok JOIN rid USING (dokumnr) WHERE dok.kuupaev>='2008-05-01' and ( ( dok.doktyyp IN ('V','G','Y','K','I','T','D','N','H','M','E','B','A','R','C','F','J','Q') AND CASE WHEN NOT dok.objrealt OR dok.doktyyp='I' THEN dok.yksus ELSE rid.kuluobjekt EN

Re: [PERFORM] Query optimization

2008-11-30 Thread Marc Cousin
Le Sunday 30 November 2008 19:45:11 tmp, vous avez écrit : > I am struggeling with the following query which fetches a random subset > of 200 questions that matches certain tags within certain languages. > However, the query takes forever to evaluate, even though I have a > "limit 200" appended. An

[PERFORM] Query optimization

2008-11-30 Thread tmp
I am struggeling with the following query which fetches a random subset of 200 questions that matches certain tags within certain languages. However, the query takes forever to evaluate, even though I have a "limit 200" appended. Any ideas on how to optimize it? QUERY:

Re: [PERFORM] Increasing GROUP BY CHAR columns speed

2008-11-30 Thread Greg Stark
On Sat, Nov 29, 2008 at 6:43 PM, Andrus <[EMAIL PROTECTED]> wrote: >> I'm still not sure why the planner chose to sort rather than hash with >> oversized work_mem (is there an implied order in the query results I >> missed?). > > Group by contains decimal column exchrate. Maybe pg is not capable to