Re: Which Join is better

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Which Join is better
Date: 2011-08-02 06:47:41
Message-ID: CAFjNrYu0W9K6ZBDEg5JDTbi4d_hsTTQx_tshvsiNc0SHzk9+hQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 2 August 2011 08:42, Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com> wrote:

> Dear all,
>
> Just want to know which join is better for querying data faster.
>
> I have 2 tables A ( 70 GB ) & B ( 7 MB )
>
> A has 10 columns & B has 3 columns.Indexes exist on both tables's ids.
>
> select p.* from table A p, B q where p.id=q.id
>
> or
>
> select p.* from table B q , A p where q.id=p.id
>
>
>
Hi,
it really doesn't matter. PostgreSQL can reorder the joins as it likes.
And you can always check, but I think the plans will be the same.

regards
Szymon

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Ayrapetyan 2011-08-02 08:26:42 Re: Performance die when COPYing to table with bigint PK
Previous Message Maria Arias de Reyna 2011-08-02 06:47:02 Re: Which Join is better