Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: EXPLAIN out...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 8 Topic 3132 of 3215
Post > Topic >>

Re: EXPLAIN output explanation requested

by andreas.kretschmer@[EMAIL PROTECTED] ("A. Kretschmer") Jun 3, 2008 at 12:35 PM

am  Tue, dem 03.06.2008, um 11:56:39 +0200 mailte Ron Arts folgendes:
> Hello all,
> 
> I have an EXPLAIN statement that gives me output I understand,
> but on the other hand I don't...
> 
> tium=# explain select codec1, phonetype from phone;
>                          QUERY PLAN
> ------------------------------------------------------------
>  Seq Scan on phone  (cost=0.00..85882.58 rows=658 width=11)
> (1 row)
> 
> 
> This is a table with 658 rows. Queries are indeed very
> slow. How is the query plan computed? What does the 85882 value
> mean?

You have no WHERE-condition, the whole table read with a sequential
scan. The 85882.58 is a calculated cost, based on seq_page_cost=1.
In other word, PG has to read about. 85882 blocks from disk, with a
block-size of 4 KByte thats about 343 MByte.

I guess, you have much insert/delete or update - operations on this
table and no recent vacuum.

Try to run a 'vacuum full;' and re-run your query. And, run a 'explain
analyse <your query>' to see the estimated costs and the real costs. 


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

-- 
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
 




 8 Posts in Topic:
EXPLAIN output explanation requested
ron.arts@[EMAIL PROTECTED  2008-06-03 11:56:39 
Re: EXPLAIN output explanation requested
andreas.kretschmer@[EMAIL  2008-06-03 12:35:34 
Re: EXPLAIN output explanation requested
andreas.kretschmer@[EMAIL  2008-06-03 12:52:28 
Re: EXPLAIN output explanation requested
ron.arts@[EMAIL PROTECTED  2008-06-03 13:10:10 
Re: EXPLAIN output explanation requested
ron.arts@[EMAIL PROTECTED  2008-06-03 19:51:05 
Re: EXPLAIN output explanation requested
andreas.kretschmer@[EMAIL  2008-06-03 20:24:58 
Re: EXPLAIN output explanation requested
andreas.kretschmer@[EMAIL  2008-06-03 20:28:39 
Re: EXPLAIN output explanation requested
andreas.kretschmer@[EMAIL  2008-06-04 09:42:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Sep 8 3:13:13 CDT 2008.