Re: Query Plan - Index Scan & Seq Scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dbadmin(at)nqadmin(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Query Plan - Index Scan & Seq Scan
Date: 2005-05-12 15:14:30
Message-ID: 886.1115910870@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Prasanth <dbadmin(at)nqadmin(dot)com> writes:
> Hash Join (cost=13865.30..326413.23 rows=6451 width=18)
> Hash Cond: ("outer".id = "inner".id)
> -> Seq Scan on a (cost=0.00..125076.37 rows=6450937 width=18)
> -> Hash (cost=10168.64..10168.64 rows=500664 width=4)
> -> Seq Scan on b (cost=0.00..10168.64 rows=500664 width=4)
> (5 rows)

> The planner used to perform a index scan. I have added a lot of data in those
> two tables. Right now both tables have millions of records.

It is highly unlikely that you want an index scan for joining millions
of records ...

However, if you do have millions in both tables, why does the planner
think there are only 500664 rows in b? Maybe you are overdue for ANALYZE.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2005-05-12 15:20:53 Re: memory allocation ; postgresql-8.0
Previous Message Kavan, Dan (IMS) 2005-05-12 15:10:00 Re: memory allocation ; postgresql-8.0