Thanks for the link Pavel, that makes perfect sense now.
Teddy
From: David G. Johnston <david.g.johnston@xxxxxxxxx>
Sent: Thursday, February 16, 2017 12:42:36 PM
To: Teddy Schmitz
Cc: pgsql-general@xxxxxxxxxxxxxx
Subject: Problems with Greatest
Sent: Thursday, February 16, 2017 12:42:36 PM
To: Teddy Schmitz
Cc: pgsql-general@xxxxxxxxxxxxxx
Subject: Problems with Greatest
On Wednesday, February 15, 2017, Teddy Schmitz <teddy.schmitz@actuallywedo.com > wrote:
select greatest(max(t1.id), max(t2.id)) from t1, t2;
I seriously doubt that the greatest function is a larger contributor to run time than the cross join between t1 and t2.
David J.