Re: Query Plan - Index Scan & Seq Scan - Mailing list pgsql-admin

From Tom Lane
Subject Re: Query Plan - Index Scan & Seq Scan
Date
Msg-id 886.1115910870@sss.pgh.pa.us
Whole thread Raw
In response to Query Plan - Index Scan & Seq Scan  (Prasanth <dbadmin@nqadmin.com>)
Responses Re: Query Plan - Index Scan & Seq Scan
List pgsql-admin
Prasanth <dbadmin@nqadmin.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

pgsql-admin by date:

Previous
From: "Kavan, Dan (IMS)"
Date:
Subject: Re: memory allocation ; postgresql-8.0
Next
From: Scott Marlowe
Date:
Subject: Re: memory allocation ; postgresql-8.0