Re: [PERFORM] Very slow left outer join

2007-05-30 Thread Tom Lane
"Tyrrill, Ed" <[EMAIL PROTECTED]> writes: > I did a vacuum analyze after inserting all the data. Is there possibly > a bug in analyze in 8.1.5-6? I know it says rows=3D436915, but the last > time the backup_location table has had that little data in it was a > couple months ago, and analyze has b

Re: [PERFORM] Very slow left outer join

2007-05-30 Thread Tyrrill, Ed
Tom Lane <[EMAIL PROTECTED]> writes: > Klint Gore <[EMAIL PROTECTED]> writes: >> On Tue, 29 May 2007 17:16:57 -0700, "Tyrrill, Ed" <[EMAIL PROTECTED]> wrote: >>> mdsdb=# explain analyze select backupobjects.record_id from >>> backupobjects left outer join backup_location using(record_id) where >>>

Re: [PERFORM] Very slow left outer join

2007-05-30 Thread Tyrrill, Ed
Michael Glaesemann <[EMAIL PROTECTED]> writes: > Off the cuff, when was the last time you vacuumed or ran ANALYZE? > Your row estimates look off by a couple orders of magnitude. With up- > to-date statistics the planner might do a better job. > > As for any other improvements, I'll leave that

Re: [PERFORM] Very slow left outer join

2007-05-29 Thread Tom Lane
Klint Gore <[EMAIL PROTECTED]> writes: > On Tue, 29 May 2007 17:16:57 -0700, "Tyrrill, Ed" <[EMAIL PROTECTED]> wrote: >> mdsdb=# explain analyze select backupobjects.record_id from >> backupobjects left outer join backup_location using(record_id) where >> backup_id = 1071; > Why are you using left

Re: [PERFORM] Very slow left outer join

2007-05-29 Thread Klint Gore
On Tue, 29 May 2007 17:16:57 -0700, "Tyrrill, Ed" <[EMAIL PROTECTED]> wrote: > mdsdb=# explain analyze select backupobjects.record_id from > backupobjects left outer join backup_location using(record_id) where > backup_id = 1071; [...] > > Here are the two tables in the query: > > mdsdb=# \d back

Re: [PERFORM] Very slow left outer join

2007-05-29 Thread Michael Glaesemann
On May 29, 2007, at 19:16 , Tyrrill, Ed wrote: - Hash Join (cost=361299.50..1054312.92 rows=34805 width=8) (actual time=1446.861..368723.597 rows=2789 loops=1) Hash Cond: ("outer".record_id = "inner".record_id) -> Seq Scan on backupobjects (cost=0.00..429929.79 rows=13136779 width

[PERFORM] Very slow left outer join

2007-05-29 Thread Tyrrill, Ed
Hi All, I have a very slow left outer join that speeds up by more then 1000 times when I turn set enable_seqscan=off. This is not the query I actually do in my application, but is a simplified one that singles out the part that is really slow. All of the columns involved in the query have indexe