Mailing List Archive

possible slow query
Hi Andrew,

I see a lot of these messages in the log file:
[Wed Mar 24 08:10:30 2010] [error] [client 172.16.1.1] davical: LOG:
always: Query: Possible slow query: SQ in
'/usr/share/davical/inc/always.php' on line 188

It seems to be a problem related to this function:
function _davical_get_principal_query_cached( $where, $parameter )

--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
F.S. Fitzgerald to Hemingway:
"Ernest, the rich are different from us."
Hemingway:
"Yes. They have more money."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20100324/9a5c2fb8/attachment.pgp>
-------------- next part --------------
possible slow query [ In reply to ]
On Wed, 2010-03-24 at 22:28 +0100, Michael Rasmussen wrote:
> Hi Andrew,
>
> I see a lot of these messages in the log file:
> [Wed Mar 24 08:10:30 2010] [error] [client 172.16.1.1] davical: LOG:
> always: Query: Possible slow query: SQ in
> '/usr/share/davical/inc/always.php' on line 188
>
> It seems to be a problem related to this function:
> function _davical_get_principal_query_cached( $where, $parameter )

Hi Michael,

Perhaps you could e-mail me (off-list) the output of the query that is
actually being logged, when run at psql, with "ANALYZE VERBOSE ", so
something like:

ANALYZE VERBOSE SELECT *, to_char(updated at time zone 'GMT','Dy, DD Mon
IYYY HH24:MI:SS "GMT"') AS modified, principal.*,
pprivs( :session_principal::int8,principal.principal_id,:scan_depth::int) AS privileges FROM usr LEFT JOIN principal USING(user_no) WHERE ?????

That function is called with different WHERE clauses & parameters, so it
could only be one particular type which is being called inefficiently.

Also, you might find performance issues disappear after you do something
like:

restart postgres
vacuum full analyze

I'm not sure how many users & calendars you have, so possibly it is just
this problem, if you have few users. If you have hundreds of users,
then it could well be an inefficient query, although it could still be a
problem with the auto vacuum not occurring, too.

Cheers,
Andrew.

------------------------------------------------------------------------
http://andrew.mcmillan.net.nz/ Porirua, New Zealand
Twitter: _karora Phone: +64(272)DEBIAN
Flexibility is overrated. Constraints are liberating.
------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20100325/0002f0e0/attachment.pgp>
-------------- next part --------------