473,770 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help required to optimize few select command.

rg
Hello,

I use invisionboard on a bid web site (20 000 visitors each day)

But my server has high load average.

Could you help me to optimize these select command.

1)
SELECT p.*, m.id,m.name,m.m group,m.email,m .joined,m.avata r,m.avatar_size ,m.posts,m.aim_ name,m.icq_numb er,
m.signature, m.website,m.yah oo,m.title,m.hi de_email,m.msnn ame, g.g_id,
g.g_title, g.g_icon FROM ibfposts p LEFT JOIN ibfmembers m ON
(p.author_id=m. id) LEFT JOIN ibfgroups g ON (g.g_id=m.mgrou p) WHERE
p.topic_id='178 49' and p.queued !='1' ORDER BY p.pid LIMIT 3555, 15
table | type | possible_keys | key | key_len | ref |
rows | Extra
--------------------------------------------------------------------------------------------------------
p | ref | topic_id | topic_id | 8 | const |
3505 | where used; Using filesort
m | eq_ref | PRIMARY | PRIMARY | 8 | p.author_id |
1 |
g | eq_ref | PRIMARY | PRIMARY | 4 | m.mgroup |
1 |

mySQL time: 1.56941
2)
SELECT DISTINCT ibfposts.author _id, ibftopics.* from ibftopics LEFT
JOIN ibfposts ON (ibftopics.tid = ibfposts.topic_ id AND
ibfposts.author _id = '1') WHERE ibftopics.forum _id='2' and
(ibftopics.last _post > '0' OR ibftopics.pinne d='1') and
ibftopics.appro ved='1' ORDER BY pinned DESC, last_post DESC LIMIT 0,18
table |type | possible_keys | key | key_len | ref
| rows | Extra
--------------------------------------------------------------------------------------------------------------------------------
ibftopics | ref | forum_id | forum_id | 4 |
const,const | 4266 | where used; Using temporary; Using filesort
ibfposts | ref | topic_id,author _id | topic_id | 12 |
ibftopics.tid,c onst | 2 | Using index

mySQL time: 1.62815
3)
SELECT t.*, f.id as forum_id, f.name as forum_name FROM ibftopics t
LEFT JOIN ibfforums f ON (f.id=t.forum_i d) WHERE t.tid
IN(0,364,20756, 24279,22728,224 99,22754,22795, 22830,23022,230 31,23128,23152, 23174,23201,232 17,23256,23816, 23290,23295,234 16,23334,23430, 23463,23469,235 00,23551,23721, 23579,23594,236 07,23639,23746, 23750,23776,238 26,23894,23923, 23924,23981,240 02,24007,24115, 24077,24104,241 20,24128,24154, 24173,24190,242 76,24359,24462, 24449,24500,245 13,24572,24522, 24684,24686,227 18,106,22729,17 849,22618,22698 ,22724,227
7,22777,22781,2 2782,22783,2278 4,22788,22798,2 2802,22732,2282 4,22856,22866,2 2868,22871,2287 2,22873,22919,1 0384,22947,2295 5,22958,22957,2 2965,22978,1257 ,22986,23000,23 007,22865,23034 ,17194,16081,23 067,19146,23087 ,23088,23099,23 132,23133,23142 ,23147,23045,23 154,23156,23159 ,23160,23162,17 417,23186,23187 ,23169,23195,23 206,23203,23164 ,23192,23232,23 234,23248,23244 ,23261,23270,23 266,23271,23273 ,23282,232
7,23084,23293,2 3306,23322,2332 4,22106,23338,2 3340,23341,2334 2,23349,23356,2 3360,23361,2333 6,23369,22745,2 3389,23395,2340 8,23428,23440,2 3441,22579,2344 7,20526,23457,2 3445,23458,2338 5,23448,23474,2 3479,23482,2348 7,23490,23493,2 3494,6757,23526 ,23533,23525,23 538,23547,23545 ,23517,23562,23 557,23552,23577 ,23578,23588,23 595,23601,23615 ,23603,23617,23 496,4035,23644, 23648,23645,236 49,23655,23650, 23660,2366
,23671,23632,23 658,23629,23684 ,23688,23692,23 704,23702,23720 ,23724,23740,23 520,23755,23760 ,23773,12844,23 777,23792,23793 ,23808,23801,23 640,23819,23814 ,23781,23835,23 849,23851,23828 ,23869,23871,23 878,23879,23881 ,23859,23884,23 888,23890,23891 ,1866,23907,239 20,23921,23922, 23940,23941,235 87,23935,23958, 23929,23965,239 03,23976,23973, 23947,24004,240 10,24017,23990, 24022,24023,240 24,24027,24029, 24035,2403
,24039,24045,24 046,24053,24055 ,24057,23352,24 048,24085,24086 ,24087,24088,10 008,23605,12061 ,24097,24100,24 109,24108,23893 ,24111,24113,24 112,24118,24119 ,24122,24130,24 157,24164,24174 ,24166,24185,24 199,24175,24206 ,22009,24204,24 208,24211,24212 ,9348,24215,242 21,24236,24239, 24240,24244,240 99,24271,24272, 24290,24294,243 00,24308,24298, 24315,19080,243 28,24333,24336, 24337,24320,243 38,24323,24362, 24365,2427
,24381,24380,24 379,24382,24394 ,24180,24403,24 427,24444,24445 ,24443,24472,24 483,24488,24490 ,24482,24499,24 505,24509,24511 ,24518,24539,24 544,24533,24537 ,24552,24569,24 575,24579,24589 ,24602,24601,32 3,24614,24624,2 1536,24651,2464 4,4689,0)
ORDER BY t.last_post desc LIMIT 0,25
table | type | possible_keys | key | key_len | ref | rows
|Extra
----------------------------------------------------------------------------------------------------
t | range | PRIMARY | PRIMARY | 8 | | 375
| where used; Using filesort
f | eq_ref | PRIMARY | PRIMARY | 2 | t.forum_id | 1
|

mySQL time: 1.76363
Thanks for help !

Best Regards
RG
Jul 19 '05 #1
0 1662

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1424
by: rg | last post by:
Hello, I use invisionboard on a bid web site (20 000 visitors each day) But my server has high load average. Could you help me to optimize these select command. 1) SELECT p.*, m.id,m.name,m.mgroup,m.email,m.joined,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number,
0
1797
by: Andreas Falck | last post by:
Hi, I ran the code below on two different versions, 4.0.14 and 4.0.16 respectively, both running RH 7.3 on intel. In version mysql server version 4.0.14 the SELECT privelege suffices for "optimize table", but (seemingly) the server version 4.0.16 requires INSERT as well. Is the INSERT privelege necessary for performing optimize in mysql
6
1381
by: Ryan Smith | last post by:
I am having a problem with a datagrid I am trying to use. I have an Access DB with two records I want to display. All that is displayed is the heading for the datagrid. I can't seem to display the actual data. Below is the Code Behind Portion: Imports System.Data.OleDb Public Class Units Inherits System.Web.UI.Page
7
2196
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from another. I have tried declaring them as shared, public, friend, etc and I always get an error stating that something is not valid on a local variable declaration. For example, in the following code for Sub DataGrid_Select, I have CurrentID and...
3
2441
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an object :(((( Anyone pls help me to solve this problem!!! thanks in advance,
4
2033
by: Huaer.XC | last post by:
>From the following MySQL command: EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON t3.name = t1.name WHERE t1.id IN(123, 124); which result is: ------------------------------------------------------------------------------------- table type possible_key key key_len ref rows Extra t1 const PK, name PK 4 const 10 t3 const PK PK 4 const 10
2
4894
by: this one | last post by:
I have the following code <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" src="..\include\gen_validatorv2.js" type="text/javascript"></script> </head>
0
5576
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.