Page 1 of 1

Performance issue with serendipity_config

Posted: Sun Mar 28, 2010 3:51 pm
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?

Re: Performance issue with serendipity_config

Posted: Mon Mar 29, 2010 9:39 am
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

Re: Performance issue with serendipity_config

Posted: Mon Mar 29, 2010 10:02 am
by kleinerChemiker
Time time gets lost for retrieving the lines, maybe storing the data in the session could improve that.

Re: Performance issue with serendipity_config

Posted: Mon Mar 29, 2010 10:25 am
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

Re: Performance issue with serendipity_config

Posted: Mon Mar 29, 2010 10:28 am
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?

Re: Performance issue with serendipity_config

Posted: Mon Mar 29, 2010 12:23 pm
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.