Re: [PERFORM] slow queries after ANALYZE

2005-11-14 Thread DW
DW wrote: Hello, I'm perplexed. I'm trying to find out why some queries are taking a long time, and have found that after running analyze, one particular query becomes slow. This query is based on a view that is based on multiple left outer joins to merge data from lots of tables. If I d

Re: [PERFORM] slow queries after ANALYZE

2005-11-12 Thread hubert depesz lubaczewski
On 11/11/05, DW <[EMAIL PROTECTED]> wrote: I'm perplexed. I'm trying to find out why some queries are taking a longtime, and have found that after running analyze,  one particular querybecomes slow. i have had exactly the same problem very recently. what helped? increasing statistics on come column

Re: [PERFORM] slow queries after ANALYZE

2005-11-11 Thread Tom Lane
DW <[EMAIL PROTECTED]> writes: > In the meantime, again I'm new to this -- I got pg_stats; which rows are > the relevent ones? The ones for columns that are mentioned in the problem query. I don't think you need to worry about columns used only in the SELECT output list, but anything used in WH

Re: [PERFORM] slow queries after ANALYZE

2005-11-11 Thread DW
Tom Lane wrote: It would be interesting to see EXPLAIN ANALYZE results in both cases, plus the contents of the relevant pg_stats rows. (BTW, you need not dump and reload to get back to the virgin state --- just delete the relevant rows from pg_statistic.) Also we'd want to know exactly what PG

Re: [PERFORM] slow queries after ANALYZE

2005-11-11 Thread Tom Lane
DW <[EMAIL PROTECTED]> writes: > I'm perplexed. I'm trying to find out why some queries are taking a long > time, and have found that after running analyze, one particular query > becomes slow. This implies that the planner's default choice of plan (without any statistics) is better than its ch

[PERFORM] slow queries after ANALYZE

2005-11-11 Thread DW
Hello, I'm perplexed. I'm trying to find out why some queries are taking a long time, and have found that after running analyze, one particular query becomes slow. This query is based on a view that is based on multiple left outer joins to merge data from lots of tables. If I drop the dat