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 Performance > Re: Performance...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 4008 of 4424
Post > Topic >>

Re: Performance of the Materialize operator in a query plan

by tgl@[EMAIL PROTECTED] (Tom Lane) Apr 21, 2008 at 10:44 AM

Viktor Rosenfeld <rosenfel@[EMAIL PROTECTED]
> writes:
> I'm having trouble understanding the cost of the Materialize  
> operator.  Consider the following plan:

> Nested Loop  (cost=2783.91..33217.37 rows=78634 width=44) (actual  
> time=77.164..2478.973 rows=309 loops=1)
>          Join Filter: ((rank2.pre <= rank5.pre) AND (rank5.pre <=  
> rank2.post))
>          ->  Nested Loop  (cost=0.00..12752.06 rows=1786 width=33)  
> (actual time=0.392..249.255 rows=9250 loops=1)
>                .....
>          ->  Materialize  (cost=2783.91..2787.87 rows=396 width=22)  
> (actual time=0.001..0.072 rows=587 loops=9250)
>                ->  Nested Loop  (cost=730.78..2783.51 rows=396  
> width=22) (actual time=7.637..27.030 rows=587 loops=1)
>                      ....

> The cost of the inner-most Nested Loop is 27 ms, but the total cost of  
> the Materialize operator is 666 ms (9250 loops * 0.072 ms per  
> iteration).  So, Materialize introduces more than 10x overhead.

Not hardly.  Had the Materialize not been there, we'd have executed
the inner nestloop 9250 times, for a total cost of 9250 * 27ms.
(Actually it might have been less due to cache effects, but still
a whole lot more than 0.072 per iteration.)

These numbers say that it's taking the Materialize about 120 microsec
per row returned, which seems a bit high to me considering that the
data is just sitting in a tuplestore.  I surmise that you are using
a machine with slow gettimeofday() and that's causing the measurement
overhead to be high.

			regards, tom lane

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




 5 Posts in Topic:
Performance of the Materialize operator in a query plan
rosenfel@[EMAIL PROTECTED  2008-04-21 13:07:22 
Re: Performance of the Materialize operator in a query plan
tgl@[EMAIL PROTECTED] (T  2008-04-21 10:44:49 
Re: Performance of the Materialize operator in a query plan
rosenfel@[EMAIL PROTECTED  2008-04-24 16:31:58 
Re: Performance of the Materialize operator in a query plan
lists@[EMAIL PROTECTED]   2008-04-24 19:05:14 
Re: Performance of the Materialize operator in a query plan
rosenfel@[EMAIL PROTECTED  2008-04-27 21:02:19 

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 Dec 1 7:24:54 CST 2008.