Re: How to read a query plan?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: elwood(at)agouros(dot)de (Konstantinos Agouros)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to read a query plan?
Date: 2001-04-18 15:15:41
Message-ID: 9761.987606941@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

elwood(at)agouros(dot)de (Konstantinos Agouros) writes:
> after this I created an index on the field webhost, now the query plan says:

CREATE INDEX updates the basic statistics about the table's size (number
of rows and disk blocks). The first plan was evidently generated using
statistics that claimed the table was empty. The second plan has rather
more plausible-looking numbers. I surmise that you did something like

CREATE TABLE ...

VACUUM (sets stats to reflect empty table)

load a bunch of data

EXPLAIN

CREATE INDEX (now stats reflect existence of data)

EXPLAIN

> Could someone give me an interpretation (or a URL that explains this)?

See the performance section of the User's Guide for a general discussion
of EXPLAIN.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Yampolsky 2001-04-18 15:20:59 Re: No backspace key in the psql command-line tool?
Previous Message S. William Schulz 2001-04-18 14:59:31 PHP and pgsql 7.1