Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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


pgsql-admin by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group