Number of disk pages obtained by explain analyze

Started by Tourtounis Sotirisover 23 years ago4 messagesgeneral
Jump to latest
#1Tourtounis Sotiris
tourtoun@csd.uoc.gr

I have a table of the form || att0 int4 | att1 int4 | att2 int4 ||
and i declare an index on att0.

With the SQL query
"select * from pg_class where relnane = 'Name of Table'

i get the information of created disk pages = 1623. However when i run an
sql query of the form "select att0 from table where att0 < A(int4) and
att0> B(int4)" i get through explain analyze the following result, which
as we see refers that in actual time have as total cost 4362.73 disk
pages. Are they the same thing or those two refer to different referring
characteristics?Thank you!!!

NOTICE: QUERY PLAN:

Index Scan using index1 on class y (cost=0.00..3662.16 rows=1266 width=4)
(actual time=0.41..4362.73 rows=253215 loops=1)
Total runtime: 4614.22 msec

NOTICE: QUERY PLAN:

Index Scan using index1 on class y (cost=0.00..3662.16 rows=1266 width=4)
(actual time=0.41..4362.73 rows=253215 loops=1)
Total runtime: 4614.22 msec

4.617384

SWTHRHS TOYRTOYNHS
(tourtoun@csd.uch.gr)

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Tourtounis Sotiris (#1)
Re: Number of disk pages obtained by explain analyze

On Tue, 24 Sep 2002, Tourtounis Sotiris wrote:

I have a table of the form || att0 int4 | att1 int4 | att2 int4 ||
and i declare an index on att0.

With the SQL query
"select * from pg_class where relnane = 'Name of Table'

i get the information of created disk pages = 1623. However when i run an
sql query of the form "select att0 from table where att0 < A(int4) and
att0> B(int4)" i get through explain analyze the following result, which
as we see refers that in actual time have as total cost 4362.73 disk
pages. Are they the same thing or those two refer to different referring
characteristics?Thank you!!

The cost is an estimate of work, not precisely disk pages (for example
random page reads default to 4 units iirc, sequential reads default to 1
unit, there's some cost for cpu work) You can find the values in
postgresql.conf.

#3Tourtounis Sotiris
tourtoun@csd.uoc.gr
In reply to: Stephan Szabo (#2)
Re: Number of disk pages obtained by explain analyze (fwd)

Thanks for the answer.

The question I have is whether or not explain analyze returns the
actual disk page access and evaluation time of a query. If not how we
can mesure them?

#4Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Tourtounis Sotiris (#3)
Re: Number of disk pages obtained by explain analyze (fwd)

On Tue, 24 Sep 2002, Tourtounis Sotiris wrote:

Thanks for the answer.

The question I have is whether or not explain analyze returns the
actual disk page access and evaluation time of a query. If not how we
can mesure them?

It returns evaluation time. I don't think it returns disk page accesses
specifically, although possibly some of the query statistics in either
the stats generator or one of the verbose logging options would do it (not
sure).