Re: Not so simple query and a half million loop

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Daniel Cristian Cruz <danielcristian(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Not so simple query and a half million loop
Date: 2008-12-02 16:07:37
Message-ID: 20081202160737.GJ5672@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

Daniel Cristian Cruz escribió:
> No one knows why I got "actual time=0.014..0.570 rows=30 loops=511222"
> and "actual time=0.005..0.006 rows=1 loops=15158976"?
>
> With:
> cu.cal_user_type = 'u' AND
> cu.cal_recur_date = COALESCE((SELECT cd.cal_start FROM egw_cal_dates
> icd WHERE icd.cal_id = cd.cal_id AND icd.cal_start = cd.cal_start AND
> icd.cal_start <> 0), 0)
> ~ 450 seconds

I don't know, but why are you using such an expression instead of an
outer join?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message DANIEL CRISTIAN CRUZ 2008-12-02 16:36:51 Re: Not so simple query and a half million loop
Previous Message Daniel Cristian Cruz 2008-12-02 16:02:35 Fwd: Not so simple query and a half million loop

Browse pgsql-performance by date

  From Date Subject
Next Message DANIEL CRISTIAN CRUZ 2008-12-02 16:36:51 Re: Not so simple query and a half million loop
Previous Message Daniel Cristian Cruz 2008-12-02 16:02:35 Fwd: Not so simple query and a half million loop