[thesite] faster queries on new w.e.o

Daniel J. Cody djc at starkmedia.com
Tue May 22 16:46:58 CDT 2001


dean, those indexes made a huge difference!

articles (Records=680, Time=728ms)
SQL = 
SELECT
    content.contentid,
    content.keyphrase,
    content.contentname,
    content.synopsis,
    content.datemod,
        content.replies,
    users.userid,
    users.who,
    categorys.category,
    categorys.categoryid,
    (SELECT Count(*) FROM replies WHERE contentid = content.contentid
AND datemod > '') AS newcomments
  FROM
    content,
    users,
    categorys
  WHERE
    content.signoff = 1
    AND content.userid = users.userid
    AND content.categoryid <> 23
    AND content.categoryid <> 26
    AND content.categoryid <> 9741
    AND content.categoryid = categorys.categoryid
  ORDER BY
    content.datemod DESC,
    content.contentid DESC

the same query on t.e.o which uses the evolttest DB and not the one that
you've been working on comes in faster too though(memory and buffers?):

articles (Records=676, Time=7078ms)
SQL = 
SELECT
    content.contentid,
    content.keyphrase,
    content.contentname,
    content.synopsis,
    content.datemod,
        content.replies,
    users.userid,
    users.who,
    categorys.category,
    categorys.categoryid,
    (SELECT Count(*) FROM replies WHERE contentid = content.contentid
AND datemod > '') AS newcomments
  FROM
    content,
    users,
    categorys
  WHERE
    content.signoff = 1
    AND content.userid = users.userid
    AND content.categoryid <> 23
    AND content.categoryid <> 26
    AND content.categoryid <> 9741
    AND content.categoryid = categorys.categoryid
  ORDER BY
    content.datemod DESC,
    content.contentid DESC

nice work by all :)

.djc.




More information about the thesite mailing list