Re: [PERFORM] Regarding Sequential Scans count increase each time we press refresh .

2009-09-27 Thread Tom Lane
Robert Haas writes: > On Thu, Sep 24, 2009 at 8:25 PM, Josh Berkus wrote: >> You can't "turn off" sequential scans.  You can only make the planner >> less likely to choose them.  But if there's no way to get the data you >> need other than a seqscan, it's still going to do one. > And that's not

Re: [PERFORM] Slow query after upgrade to 8.4

2009-09-27 Thread Robert Haas
On Thu, Sep 24, 2009 at 8:22 AM, Jared Beck wrote: > Should we try to improve statistics collection for that column > (variableid) by using ALTER TABLE ... ALTER COLUMN ... SET STATISTICS? It's worth a try, but I'm not sure it's going to help much. The LIKE condition is hard for the planner to e

Re: [PERFORM] query memory consumption

2009-09-27 Thread Robert Haas
2009/9/25 Jeff Janes : > 2009/9/22 Grzegorz Jaśkiewicz : >> On Tue, Sep 22, 2009 at 1:46 PM, Alan McKay wrote: Best practice to avoid that, is to bump the work_mem temporarily before the query, and than lower it again, lowers the chance of memory exhaustion. >>> >>> Interesting - I

Re: [PERFORM] Regarding Sequential Scans count increase each time we press refresh .

2009-09-27 Thread Robert Haas
On Thu, Sep 24, 2009 at 8:25 PM, Josh Berkus wrote: > You can't "turn off" sequential scans.  You can only make the planner > less likely to choose them.  But if there's no way to get the data you > need other than a seqscan, it's still going to do one. And that's not a bad thing. For a very sma

Re: [PERFORM] Many left outer joins with limit performance

2009-09-27 Thread Gerhard Wiesinger
Hello Tom, The query was logically ok. The main problem was that the VIEW had an ORDER BY clause where cost went up to very high. Indices and unique constraints were minor optimizations. Conclusio: Don't create ORDER BY in VIEW unless really necessary Ciao, Gerhard -- http://www.wiesinger.c