Re: Checkpoint_segments optimal value

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Checkpoint_segments optimal value
Date: 2014-07-17 23:51:33
Message-ID: 53C86185.2020506@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On 7/17/2014 11:28 AM, Prabhjot Sheena wrote:
>
> SELECT account.id <http://account.id>, account.organization_id,
> run.application_id, work_unit.script, work_unit.id
> <http://work_unit.id>, work_unit.start_time, run.id <http://run.id>,
> work_unit.priority FROM work_unit, run, account WHERE
> work_unit.status = 3 AND work_unit.run_id = run.id <http://run.id> AND
> work_unit.type != 1 AND run.status = 1 AND run.account_id = account.id
> <http://account.id>

that query is an implied 3-way join. it would be clearer to write it
like...

SELECT account.id <http://account.id>, account.organization_id,
run.application_id, work_unit.script, work_unit.id
<http://work_unit.id>, work_unit.start_time, run.id <http://run.id>,
work_unit.priority
FROM work_unit
JOIN run ON work_unit.run_id = run.id <http://run.id>
JOIN account ON run.account_id = account.id <http://account.id>
WHERE work_unit.status = 3 AND work_unit.type != 1 AND run.status = 1;

postgres would (or at least should) treat this exactly the same, but its
clearer what the query is doing when its written this way.

--
john r pierce 37N 122W
somewhere on the middle of the left coast

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Prabhjot Sheena 2014-07-18 00:01:51 Re: Checkpoint_segments optimal value
Previous Message John R Pierce 2014-07-17 23:45:27 Re: Checkpoint_segments optimal value

Browse pgsql-general by date

  From Date Subject
Next Message Prabhjot Sheena 2014-07-18 00:01:51 Re: Checkpoint_segments optimal value
Previous Message John R Pierce 2014-07-17 23:45:27 Re: Checkpoint_segments optimal value