Hello all,
Recently a post on this list made me think a bit about the way in which I
write my queries.
I have always written queries with ordinary joins in this manner:
SELECT * FROM a, b WHERE a.x=b.x;
However I recently saw an laternative syntax:
SELECT * FROM a JOIN b ON a.x=b.x;
Is there any difference between these queries in terms of the speed of
planning or the quality of the plan untimately used? I'd imagine that the
second form provides more information that the planner may be able to use
to make a better plan (or make a good plan more easily), but I've never
had any problems with the first form.
It also seems to me that the second form is more self-documenting, which
is something I'm always in favour of.
I'd appreciate anyone's thought/insight.
Thanks.
--
Russell Brown
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Recently a post on this list made me think a bit about the way in which I
write my queries.
I have always written queries with ordinary joins in this manner:
SELECT * FROM a, b WHERE a.x=b.x;
However I recently saw an laternative syntax:
SELECT * FROM a JOIN b ON a.x=b.x;
Is there any difference between these queries in terms of the speed of
planning or the quality of the plan untimately used? I'd imagine that the
second form provides more information that the planner may be able to use
to make a better plan (or make a good plan more easily), but I've never
had any problems with the first form.
It also seems to me that the second form is more self-documenting, which
is something I'm always in favour of.
I'd appreciate anyone's thought/insight.
Thanks.
--
Russell Brown
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Comment