Re: [GENERAL] QUERY PLAN:

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: Tim Joyce <tim(at)hoop(dot)co(dot)uk>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] QUERY PLAN:
Date: 1999-10-27 15:09:13
Message-ID: 19991027100913.A21159@wallace.ece.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 27, 1999 at 11:03:45AM +0100, Tim Joyce wrote:
> can someone point me at documentation so that i can unserstand the results
> of an EXPLAIN, eg:
>
> Index Scan using words_id_idx on books_idx (cost=441.19 rows=7644 width=8)
>
> explain select * from books_idx where wrd_id=1;
>
> I am paticularly interested in what the rows= figure means.

I've picked up a little info on this from following the hackers list,
so I don't know what docs to point you at. My understanding is that the
rows= represents the number of tuples the optimizer estimates will be
returned by that step of the execution plan. In the example you've shown,
it's an index scan of a field, and the estimate (based on last know number
of tuples in the table (as of your last VACUUM ANALYZE) and an estimate
of the selectivity of the operator being applied to this index (<, =,
>, etc), and the approximate dispersion of the values in that field.

For more detail, I'd suggest checking the archives of the pgsql-hackers
list, and perhaps then asking on the list itself. There's some hints in the
"PostgreSQL Programmer's Guide" in the "Extending SQL" sections on functions,
operators, and interfacing them to indices.

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alain TESIO 1999-10-27 15:22:33 Re: [GENERAL] how to insert from sequence
Previous Message Shadkam Islam 1999-10-27 14:56:41 Re: [GENERAL] how to insert from sequence