From: | Viktor Lacina <viktor(at)lacina(dot)org> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: general questions about joins in queries |
Date: | 2006-01-17 11:25:35 |
Message-ID: | 200601171225.35405.viktor@lacina.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
it's the same , try "EXPLAIN <query>" if you are not sure.
Viktor
Dne pondělí 16 ledna 2006 18:01 Zlatko Matić napsal(a):
> Hello.
> Is it better to use A) or B) ?
>
> A)
>
> SELECT
> "public"."departments".*,
> "public"."plants".*,
> "public"."batches_microbs".*,
> "public"."results_microbs".*
> FROM
> "public"."departments",
> "public"."plants",
> "public"."batches_microbs",
> "public"."results_microbs"
> WHERE
> "plants"."department" = "departments"."department" AND
> "batches_microbs"."plant" = "plants"."plant" AND
> "results_microbs"."batch" = "batches_microbs"."batch"
>
> B)
>
> SELECT
> "public"."departments".*,
> "public"."plants".*,
> "public"."batches_microbs".*,
> "public"."results_microbs".*
> FROM
> public.departments
> INNER JOIN public.plants ON (public.departments.department =
> public.plants.department) INNER JOIN public.batches_microbs ON
> (public.plants.plant = public.batches_microbs.plant) INNER JOIN
> public.results_microbs ON (public.batches_microbs.batch =
> public.results_microbs.batch)
>
>
> Thanks,
>
> Zlatko
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Glaesemann | 2006-01-17 12:46:27 | Re: A tale of two similar databases |
Previous Message | frank church | 2006-01-17 09:38:37 | Is there a way to list runaway queries and kill them? |