Can anyone create a memcache plugin?
Posted: Thu Nov 05, 2009 11:28 pm
There seem to be two queries that are responsible for most of the mySQL load.. and sometimes, that load can be sufficient to bring mysql to its knees even though the hardware is not at maximum.
Once upon a time, someone who knows a heck of a lot more about databases than I suggested that we have 2 queries that are responsible for most of the mysql processing:
This one seems to simply be getting recent entries:
And this one which seems to be getting the total number of entries:
If there is a way to make these more efficient, but all means lets do it. But he also said that, notwithstanding changes to how those queries work, that these sites would benefit tremendously if serendipity could work with memcached.
So, anyone interested in writing a plugin that will utilize memcache?
Once upon a time, someone who knows a heck of a lot more about databases than I suggested that we have 2 queries that are responsible for most of the mysql processing:
This one seems to simply be getting recent entries:
Code: Select all
SELECT
ep_sticky.value AS orderkey,
e.id,
e.title,
e.timestamp,
e.comments,
e.exflag,
e.authorid,
e.trackbacks,
e.isdraft,
e.allow_comments,
e.last_modified,
a.realname AS author,
a.username AS loginname,
a.email
, e.body, e.extended
FROM
serendipity_entries AS e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
LEFT JOIN serendipity_category c
ON ec.categoryid = c.categoryid
LEFT OUTER JOIN serendipity_entryproperties
ep_no_frontpage
ON (e.id =
ep_no_frontpage.entryid AND ep_no_frontpage.property =
'ep_no_frontpage')
LEFT OUTER JOIN serendipity_entryproperties ep_access
ON (e.id =
ep_access.entryid AND ep_access.property = 'ep_access')
LEFT JOIN serendipity_entryproperties ep_sticky
ON (e.id =
ep_sticky.entryid AND ep_sticky.property = 'ep_is_sticky')
WHERE isdraft = 'false' AND e.timestamp <=
1225306200 AND (ep_access.property IS NULL OR ep_access.value =
'public') AND (ep_no_frontpage.property IS NULL OR
ep_no_frontpage.value
!= 'true')
GROUP BY e.id
ORDER BY orderkey DESC, timestamp DESC
LIMIT 10;Code: Select all
SELECT count(distinct e.id)
FROM
serendipity_entries AS e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
LEFT JOIN serendipity_category c
ON ec.categoryid = c.categoryid
LEFT OUTER JOIN serendipity_entryproperties
ep_no_frontpage
ON (e.id =
ep_no_frontpage.entryid AND ep_no_frontpage.property =
'ep_no_frontpage')
LEFT OUTER JOIN serendipity_entryproperties ep_access
ON (e.id =
ep_access.entryid AND ep_access.property = 'ep_access')
LEFT JOIN serendipity_entryproperties ep_sticky
ON (e.id =
ep_sticky.entryid AND ep_sticky.property = 'ep_is_sticky')
WHERE isdraft = 'false' AND e.timestamp <=
1225305900 AND (ep_access.property IS NULL OR ep_access.value =
'public') AND (ep_no_frontpage.property IS NULL OR
ep_no_frontpage.value
!= 'true');So, anyone interested in writing a plugin that will utilize memcache?