Gayner Posted August 30, 2009 Share Posted August 30, 2009 And too bad I dont know anything about mysql to make it shorter? SELECT DISTINCT(ibf_posts.author_id), ibf_topics.*, mr.mgroup, mr.desktop as desktop2, ibf_members.desktop, ibf_members.id, ibf_members.mgroup, ibf_groups.g_id FROM ibf_topics LEFT JOIN ibf_posts ON (ibf_topics.tid=ibf_posts.topic_id AND ibf_posts.author_id=".$ibforums->member['id'].") LEFT JOIN ibf_members ON (starter_id=ibf_members.id) LEFT JOIN ibf_members mr ON (mr.id=last_poster_id) LEFT JOIN ibf_groups ON (ibf_groups.g_id=ibf_members.mgroup) LEFT JOIN ibf_groups g ON (g.g_id=mr.mgroup) WHERE ibf_topics.forum_id=".$this->forum['id']." and ibf_topics.approved=1 and (ibf_topics.pinned=1 or ibf_topics.last_post > $Prune) There has to be a way right?.. This is for my forum system, it was wrote in 2003 this is to display list of Topics(Forums.php) Can somone please be really generous right and sum this query up or tell me how I can? Thanks.. lol Hi, i made is smaller: SELECT DISTINCT(ibf_posts.author_id), ibf_topics.*, mr.mgroup, mr.desktop as desktop2, ibf_members.desktop, ibf_members.id, ibf_members.mgroup, ibf_groups.g_id FROM ibf_topics LEFT JOIN ibf_posts ON (ibf_topics.tid=ibf_posts.topic_id AND ibf_posts.author_id=".$ibforums->member['id'].") LEFT JOIN ibf_members ON (starter_id=ibf_members.id) LEFT JOIN ibf_members mr ON (mr.id=last_poster_id) LEFT JOIN ibf_groups ON (ibf_groups.g_id=ibf_members.mgroup) LEFT JOIN ibf_groups g ON (g.g_id=mr.mgroup) WHERE ibf_topics.forum_id=".$this->forum['id']." and ibf_topics.approved=1 and (ibf_topics.pinned=1 or ibf_topics.last_post > $Prune) can people make it smaller? lol Quote Link to comment https://forums.phpfreaks.com/topic/172439-this-query-is-way-to-big/ Share on other sites More sharing options...
TheFilmGod Posted August 30, 2009 Share Posted August 30, 2009 EdIt: Woah. My bad. I don't know, for some I got the boards mixed up. It would help if you provided the table definitions. It's hard go through the super huge join and help you out. What data are you pulling out anyway? Quote Link to comment https://forums.phpfreaks.com/topic/172439-this-query-is-way-to-big/#findComment-909113 Share on other sites More sharing options...
Gayner Posted August 30, 2009 Author Share Posted August 30, 2009 How is this php? There's a mysql form for that. Oops sorry I Thought same thing, thx mod for moving it XD Quote Link to comment https://forums.phpfreaks.com/topic/172439-this-query-is-way-to-big/#findComment-909114 Share on other sites More sharing options...
Gayner Posted August 30, 2009 Author Share Posted August 30, 2009 EdIt: Woah. My bad. I don't know, for some I got the boards mixed up. It would help if you provided the table definitions. It's hard go through the super huge join and help you out. What data are you pulling out anyway? Yea sure np: Quote Link to comment https://forums.phpfreaks.com/topic/172439-this-query-is-way-to-big/#findComment-909116 Share on other sites More sharing options...
fenway Posted September 7, 2009 Share Posted September 7, 2009 That's not helpful... we need table definitions for the tables being queried, EXPLAIN output, etc.. see my sig. Quote Link to comment https://forums.phpfreaks.com/topic/172439-this-query-is-way-to-big/#findComment-914135 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.