Skip site navigation (1) Skip section navigation (2)

Re: Not so simple query and a half million loop

From: "Daniel Cristian Cruz" <danielcristian(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Not so simple query and a half million loop
Date: 2008-12-02 10:10:14
Message-ID: 48d0cacb0812020210s22d44b84nc0a6719c97502e87@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-performance
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(at)gmail(dot)com>:
> Maybe someone would like to see it without broken lines (I do).
>
> Regards,
>
> 2008/12/1 Daniel Cristian Cruz <danielcristian(at)gmail(dot)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
> クルズ  クリスチアン ダニエル
>



-- 
Daniel Cristian Cruz
クルズ  クリスチアン ダニエル

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2008-12-02 10:34:13
Subject: Re: Sort causes system to freeze
Previous:From: Richard HuxtonDate: 2008-12-02 09:59:04
Subject: Re: Sort causes system to freeze

pgsql-admin by date

Next:From: Alvaro HerreraDate: 2008-12-02 13:46:06
Subject: Re: Logging autovacuum
Previous:From: Suresh BorseDate: 2008-12-02 05:49:09
Subject: Re: change user passwd

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group