Re: Not so simple query and a half million loop - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: Not so simple query and a half million loop
Date
Msg-id 20081202160737.GJ5672@alvh.no-ip.org
Whole thread Raw
In response to Re: Not so simple query and a half million loop  ("Daniel Cristian Cruz" <danielcristian@gmail.com>)
Responses Re: Not so simple query and a half million loop  (DANIEL CRISTIAN CRUZ <daniel.cruz@sc.senai.br>)
List pgsql-admin
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

pgsql-admin by date:

Previous
From: Isabella Ghiurea
Date:
Subject: Re: change user passwd
Next
From: DANIEL CRISTIAN CRUZ
Date:
Subject: Re: Not so simple query and a half million loop