Performance issue with serendipity_config

Discussion corner for Developers of Serendipity.
Post Reply
ads
Regular
Posts: 93
Joined: Sun Oct 29, 2006 11:39 am

Performance issue with serendipity_config

Post by ads »

Hi,

The table "serendipity_config" contains configuration values. So far, so good. On my blog there are only two registered users, so this table contains 450 entries in sum. 420 entries for 'authorid = 0', 15 rows for each user. This query is executed for every request:

Code: Select all

SELECT name, value
  FROM serendipity_config           
 WHERE authorid = 0
Obviously this results in a full table scan, because most values match the criteria. In addition the log shows a 250 ms runtime for this query. This is very long.

Digging deeper i found out, that the query itself only takes ~ 5 milliseconds. It seems, the application (S9y) needs a very long time to actually fetch all the 420 rows from the database.

Is it possible to speed up this read?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Performance issue with serendipity_config

Post by garvinhicking »

Hi!

I'm afraid I know no other way to fetch the DB configuration. If we extract it to a file and include that file instead, this might create synchronization trouble.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
kleinerChemiker
Regular
Posts: 765
Joined: Tue Oct 17, 2006 2:36 pm
Location: Vienna/Austria
Contact:

Re: Performance issue with serendipity_config

Post by kleinerChemiker »

Time time gets lost for retrieving the lines, maybe storing the data in the session could improve that.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Performance issue with serendipity_config

Post by garvinhicking »

Hi!

But if plugins change values in the database, and users are surfing with a session where those changes contain old values, this may lead to inconsistency. And we can't easily carry around a flag that says "reload session data", and a plugin can only change the session data of the current user, not all other users that might be surfing with session data...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
kleinerChemiker
Regular
Posts: 765
Joined: Tue Oct 17, 2006 2:36 pm
Location: Vienna/Austria
Contact:

Re: Performance issue with serendipity_config

Post by kleinerChemiker »

Right, that would be a problem. Can the config data in the db set directly or only by the use of a s9y function? So is there a point every change has to pass?
ads
Regular
Posts: 93
Joined: Sun Oct 29, 2006 11:39 am

Re: Performance issue with serendipity_config

Post by ads »

What i don't understand: why needs PHP 245 ms (on my box) to actually retrieve the 420 lines? This should not be expensive at all.
Post Reply