Re: [SQL] Difference between these two queries ? - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: [SQL] Difference between these two queries ?
Date
Msg-id AANLkTikoKnZQ9pcBAw7WutWjTWmNt2AsftpojbNEjrgR@mail.gmail.com
Whole thread Raw
In response to Difference between these two queries ?  (Nilesh Govindarajan <lists@itech7.com>)
List pgsql-general
On 6 June 2010 06:30, Nilesh Govindarajan <lists@itech7.com> wrote:
> 1. SELECT b.* from banners b, banners_users bu where b.id = bu.bid and
> bu.uid = 5;
>
> 2. SELECT b.* from banners b INNER JOIN banners_users bu ON b.id =
> bu.bid AND bu.uid = 5;

Here is an explanation:
http://www.postgresql.org/docs/8.4/interactive/queries-table-expressions.html#QUERIES-FROM

>
> What is the first type of join called ?

CROSS JOIN

>
> and is it possible that they have different execution times ?

AFAIK planner would choose the same execution plan in your situation
so it is not.

--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802

pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: Dell Poweredge server and Postgres
Next
From: u235sentinel
Date:
Subject: Re: Dell Poweredge server and Postgres