Skip site navigation (1) Skip section navigation (2)

query execution question

From: amit sehas <cun23(at)yahoo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: query execution question
Date: 2011-02-09 19:16:11
Message-ID: 872907.86083.qm@web32203.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-hackers
We are making some performance measurements, we are trying to determine query execution behavior. Lets say we have 4 tables T1, T2, T3 and T4

and the query has the form:

select * from T1, T2, T3, T4 where (T1.a = T2.b   and  T2.c = T3.d
 T3.e = T4.f)  

where a,b,c,d,e,f are properties of the respective tables.

Lets say that the cost based optimizer determines that the order of the joins should be   T1.a=T2.b followed by T2.c = T3.d followed by T3.e = T4.f

the question we have is during query execution are the joins evaluated completely one by one in that order, or the first join is evaluated completely and generates an intermediate table which is then utilized to perform the next join....this means that for such a query we will need space for all the intermediate tables, which if they are very large tables as they are in our case can significantly alter the cost of the operations...

thanks

-Ashish



      

Responses

pgsql-hackers by date

Next:From: A.M.Date: 2011-02-09 19:16:18
Subject: Re: SSI patch version 14
Previous:From: Stephen FrostDate: 2011-02-09 19:10:28
Subject: Re: patches that could use additional reviewers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group