Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Pligg Dev peppolone's Avatar
    Joined
    Dec 2006
    Posts
    187

    [SOLVED] Query fix (speed up)

    i saw there was always one query in my db
    Code:
    SELECT link_id, count( link_id ) AS count FROM pligg_links, pligg_categories WHERE category_lang = 'en' AND category_id = link_category GROUP BY link_category ORDER BY category_name ASC ;
    it takes about 1 second and resides in the file /libs/html1.php
    i removed the line
    Code:
    $sql = "select *,  count(*) as count from " . table_links . ", " . table_categories . " where category_lang='$dblang' and category_id=link_category group by link_category ORDER BY category_name ASC";
    and now my site is very fast, this is the best fix i found.
    i know it is for categorylist, but all in my sidebar works fine, i think it is an old query, i found it only in pligg 8.0 into categories.tpl
    {section name=nr loop=$categorylist}
    now we have loop=$cat_array
    sry for my english

  2. #2
    Constant Pligger xiesi's Avatar
    Joined
    Jun 2007
    Posts
    223
    yes!!Affter i removed is very fast.thanks

  3. #3
    New Pligger TypeEE's Avatar
    Joined
    Jul 2008
    Posts
    28
    Did you remove all the 3 lines?

    PHP Code:
    $sql "select *,  count(*) as count from " table_links ", " table_categories " where category_lang='$dblang' and category_id=link_category group by link_category ORDER BY category_name ASC";
    $categorylist object_2_array($db->get_results($sql));
    $var_smarty->assign('categorylist'$categorylist); 

  4. #4
    Pligg Dev peppolone's Avatar
    Joined
    Dec 2006
    Posts
    187
    Quote Originally Posted by TypeEE View Post
    Did you remove all the 3 lines?

    PHP Code:
    $sql "select *,  count(*) as count from " table_links ", " table_categories " where category_lang='$dblang' and category_id=link_category group by link_category ORDER BY category_name ASC";
    $categorylist object_2_array($db->get_results($sql));
    $var_smarty->assign('categorylist'$categorylist); 
    yes remove all categorylist.
    thank me on the first post if you like my fix.

  5. #5
    New Pligger TypeEE's Avatar
    Joined
    Jul 2008
    Posts
    28
    Thank you!!!

  6. #6
    Pligg Founder Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,062
    Site
    http://pligg.com/demo/
    Added to Pligg SVN.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  7. #7
    Pligg Dev peppolone's Avatar
    Joined
    Dec 2006
    Posts
    187
    :not me: when can i find my name into the code lol :lol:

  8. #8
    Pligg Donor rubber2002's Avatar
    Joined
    Jul 2007
    Posts
    286
    thanks. After I remove the code you suggested, my site is fast.

  9. #9
    Casual Pligger ArturOzimek's Avatar
    Joined
    Jul 2008
    Posts
    38
    My site is much faster as well. well done.thanks

  10. #10
    New Pligger neo2cold's Avatar
    Joined
    Jul 2008
    Posts
    10
    Thanks so much for this , this really helps

Page 1 of 2 12 LastLast

Similar Threads

  1. How to improve Page Speed
    By tesurrajan in forum Questions & Comments
    Replies: 2
    Last Post: 09-07-2011, 10:12 AM
  2. site speed is terrible
    By wediggcouk in forum Questions & Comments
    Replies: 12
    Last Post: 07-04-2011, 03:20 PM
  3. HOW TO: speed up your pligg site?
    By sadegazoz in forum Questions & Comments
    Replies: 13
    Last Post: 05-23-2010, 06:44 PM
  4. A tip to speed up Pligg
    By swiper in forum Questions & Comments
    Replies: 46
    Last Post: 04-30-2008, 08:29 AM
  5. Testing the Speed of your Site
    By acidride in forum Questions & Comments
    Replies: 3
    Last Post: 04-09-2007, 10:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting