Announcement

Collapse
No announcement yet.

need help on slow query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • need help on slow query

    hi,

    can anyone advise me from which activity this query is coming from? im logging slow query and these 3 queries really get logged many times. also kindly advise any solution if you have any.. tq

    1. SELECT post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
    user.*, userfield.*
    , '' AS field15, '' AS field21, '' AS field22, '' AS field23, '' AS field24


    FROM post AS post
    LEFT JOIN user AS user ON(user.userid = post.userid)
    LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid)


    WHERE threadid = 35612


    ORDER BY postid;

    2. SELECT
    post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
    user.*, userfield.*, usertextfield.*,
    icon.title as icontitle, icon.iconpath,
    avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS $




    editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
    editlog.reason AS edit_reason, editlog.hashistory,
    postparsed.pagetext_html, postparsed.hasimages,
    sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages,
    sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight,
    IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
    , '' AS field15, '' AS field21, '' AS field22, '' AS field23, '' AS field24
    ,blog_user.entries
    FROM post AS post
    LEFT JOIN user AS user ON(user.userid = post.userid)
    LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid)
    LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
    LEFT JOIN icon AS icon ON(icon.iconid = post.iconid)
    LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)




    LEFT JOIN editlog AS editlog ON(editlog.postid = post.postid)
    LEFT JOIN postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = 7 AND postparsed.languageid = 1)
    LEFT JOIN sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = 7 AND sigparsed.languageid = 1)
    LEFT JOIN sigpic AS sigpic ON(sigpic.userid = post.userid)
    LEFT JOIN blog_user AS blog_user ON (blog_user.bloguserid = post.userid)
    WHERE post.postid IN (0,12910040,12910513,12910546,12910558,12910587,12910680,12910756,12910773,12910783,129107 88)
    ORDER BY post.dateline;

    3. UPDATE user

    SET lastactivity = 1334487360
    WHERE userid = 46353;

    thanks
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X