Search Postgresql Archives

Query optimization (select single record and join)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have the following sql:

CREATE OR REPLACE FUNCTION foo (in x integer) RETURNS float AS $$
	SELECT max(tableB.columnC)
	FROM
		tableA inner join tableB on (tableA.columnA =
tableB.columnB)
	WHERE
		tableA.columbA = x
... (additional code to select which of the many "foo" records referencing
the same row in the foreign table is the one we want)

What I am wondering is whether the database first eliminate all rows in
tableA that don't meet the criteria before performing the join, or does it
perform the join first then eliminate all records that don't meet the
criteria?

Thanks,
Orest



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux