pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Cristian Cruz <danielcristian@gmail.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Not so simple query and a half million loop
Date: Tue, 2 Dec 2008 08:10:14 -0200
Message-ID: <48d0cacb0812020210s22d44b84nc0a6719c97502e87@mail.gmail.com> (raw)
In-Reply-To: <48d0cacb0812010721t783bdcd9g36090504b7070a06@mail.gmail.com>
References: <48d0cacb0812010526i7c51b29fs9319618b3aaf3f49@mail.gmail.com>
	<48d0cacb0812010721t783bdcd9g36090504b7070a06@mail.gmail.com>

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

With
 cu.cal_user_type = 'u'
 ~ 130 ms

With
 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)
 ~ 1 second

I've tryied to increase statistics to maximum, with no success.

This is the eGroupware database schema, with a few records.

Regards,

2008/12/1 Daniel Cristian Cruz <danielcristian@gmail.com>:
> Maybe someone would like to see it without broken lines (I do).
>
> Regards,
>
> 2008/12/1 Daniel Cristian Cruz <danielcristian@gmail.com>:
>> I've tryied 4 times to post this message to pgsql-performance without
>> success... No return, even an error...
>>
>> Below is my problem; a query that perform bad when using a filter almost equal.
>>
>> ...
>
> --
> Daniel Cristian Cruz
> クルズ  クリスチウ3柑ン ダニエル
>



-- 
Daniel Cristian Cruz
クルズ  クリスチウ3柑ン ダニエル



view thread (7+ messages)  latest in thread

Message-ID: <48d0cacb0812020210s22d44b84nc0a6719c97502e87@mail.gmail.com>
Permalink:  ../48d0cacb0812020210s22d44b84nc0a6719c97502e87@mail.gmail.com/
Also on:    postgresql.org/message-id/48d0cacb0812020210s22d44b84nc0a6719c97502e87@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: danielcristian@gmail.com, pgsql-admin@postgresql.org
  Subject: Re: Not so simple query and a half million loop
  In-Reply-To: <48d0cacb0812020210s22d44b84nc0a6719c97502e87@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox