pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dbadmin@nqadmin.com
Cc: pgsql-admin@postgresql.org
Subject: Re: Query Plan - Index Scan & Seq Scan
Date: Thu, 12 May 2005 11:14:30 -0400
Message-ID: <886.1115910870@sss.pgh.pa.us> (raw)
In-Reply-To: <428370AC.3070207@nqadmin.com>
References: <428370AC.3070207@nqadmin.com>

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



view thread (14+ messages)  latest in thread

Message-ID: <886.1115910870@sss.pgh.pa.us>
Permalink:  ../886.1115910870@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/886.1115910870@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dbadmin@nqadmin.com
  Subject: Re: Query Plan - Index Scan & Seq Scan
  In-Reply-To: <886.1115910870@sss.pgh.pa.us>
  References: <428370AC.3070207@nqadmin.com> <886.1115910870@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox