| From: | Christopher Browne <cbbrowne(at)libertyrms(dot)info> |
|---|---|
| To: | "Fernando Papa" <fpapa(at)claxson(dot)com> |
| Cc: | pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: I can't wait too much: Total runtime 432478.44 msec |
| Date: | 2003-08-01 21:27:08 |
| Message-ID: | 60u191jcgj.fsf@dev6.int.libertyrms.info |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
I'd point at the following as being a sterling candidate for being a
cause of this being slow...
AND cont_publicacion.fecha_publicacion = (SELECT max(cp1.fecha_publicacion)
FROM cont_publicacion cp1
WHERE cp1.id_instalacion = cont_publicacion.id_instalacion
AND cp1.id_contenido = cont_publicacion.id_contenido
AND cp1.generar_vainilla = cont_publicacion.generar_vainilla)
May I suggest changing it to:
AND cont_publicacion.fecha_publicacion = (SELECT cp1.fecha_publicacion
FROM cont_publicacion cp1
WHERE cp1.id_instalacion = cont_publicacion.id_instalacion
AND cp1.id_contenido = cont_publicacion.id_contenido
AND cp1.generar_vainilla = cont_publicacion.generar_vainilla
ORDER BY fecha_publicacion LIMIT 1)
That would get rid of the aggregate that's sitting deep in the query.
--
select 'cbbrowne' || '@' || 'libertyrms.info';
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 646 3304 x124 (land)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Josh Berkus | 2003-08-01 21:31:52 | Re: I can't wait too much: Total runtime 432478.44 msec |
| Previous Message | Josh Berkus | 2003-08-01 21:18:51 | Re: How number of columns affects performance |