Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2008, 02:15 PM
peppolone's Avatar
Pligg Donor
Pligg Version: 995-54
Pligg Template: upnews.it
 
Join Date: Dec 2006
Location: rome
Posts: 125
Thanks: 2
Thanked 35 Times in 13 Posts
[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
__________________
My pligg site: www.upnews.it

Last edited by peppolone; 07-31-2008 at 03:05 PM..
Reply With Quote
The Following 14 Users Say Thank You to peppolone For This Useful Post:
  #2 (permalink)  
Old 08-01-2008, 09:03 AM
xiesi's Avatar
Constant Pligger
Pligg Version: 9.95
Pligg Template: yget + diy
 
Join Date: Jun 2007
Posts: 226
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to xiesi
yes!!Affter i removed is very fast.thanks
__________________
www.qelele.com齐乐乐
Reply With Quote
  #3 (permalink)  
Old 08-01-2008, 09:46 AM
Casual Pligger
 
Join Date: Jul 2008
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
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); 
Reply With Quote
  #4 (permalink)  
Old 08-01-2008, 10:27 AM
peppolone's Avatar
Pligg Donor
Pligg Version: 995-54
Pligg Template: upnews.it
 
Join Date: Dec 2006
Location: rome
Posts: 125
Thanks: 2
Thanked 35 Times in 13 Posts
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.
__________________
My pligg site: www.upnews.it
Reply With Quote
  #5 (permalink)  
Old 08-01-2008, 10:49 AM
Casual Pligger
 
Join Date: Jul 2008
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Thank you!!!
Reply With Quote
  #6 (permalink)  
Old 08-01-2008, 03:23 PM
Yankidank's Avatar
Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 1,833
Thanks: 110
Thanked 183 Times in 129 Posts
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
Added to Pligg SVN.
__________________
Need a Pligg Host?
Get 3 free months
when you buy a year of hosting.
Use the coupon PLIGG at either...
MidPhase hosting starting at $7.95/month.
ANhosting hosting starting as low as $4.95/month.
Reply With Quote
  #7 (permalink)  
Old 08-01-2008, 04:35 PM
peppolone's Avatar
Pligg Donor
Pligg Version: 995-54
Pligg Template: upnews.it
 
Join Date: Dec 2006
Location: rome
Posts: 125
Thanks: 2
Thanked 35 Times in 13 Posts
when can i find my name into the code lol
__________________
My pligg site: www.upnews.it
Reply With Quote
  #8 (permalink)  
Old 08-01-2008, 05:48 PM
rubber2002's Avatar
Pligg Donor
 
Join Date: Jul 2007
Posts: 252
Thanks: 30
Thanked 7 Times in 6 Posts
thanks. After I remove the code you suggested, my site is fast.
Reply With Quote
  #9 (permalink)  
Old 10-05-2008, 02:40 PM
ArturOzimek's Avatar
Coder
 
Join Date: Jul 2008
Posts: 42
Thanks: 3
Thanked 8 Times in 5 Posts
My site is much faster as well. well done.thanks
Reply With Quote
  #10 (permalink)  
Old 10-05-2008, 03:44 PM
New Pligger
 
Join Date: Jul 2008
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks so much for this , this really helps
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Found a way to speed up pligg tonuonu Suggestions 10 04-13-2008 05:42 PM
The Real Cause Of High Load For My Server Using PLigg 9.9 and Was 9.8.2 argh2xxx Bug Report 18 01-10-2008 04:33 PM
Custom Query.. But How? borbor General Help 3 12-09-2007 10:06 PM
'max_user_connections' suddenly exceeded mightyb Bug Report 10 06-13-2007 04:40 PM
Reducing query count in comments revenazb General Help 5 04-17-2007 12:37 AM


Search Engine Friendly URLs by vBSEO 3.2.0