473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

20 Different Tables querys slowing page display

162 100+
Hello Fellow Programmers,

I have an issue with a very large PHP page that calls over 20 different MySql Statements. This page is loading somewhat slow and i want to speed things up. I have looked into sql caching applications like http://eaccelerator.net/ and http://www.danga.com/memcached/ which i may install later, but i feel they are more for pages that are called frequently, my page calls the same data less times but can call more than 2000 different versions of the data.

Being that my page is a little over 1000 lines, putting it all here is not gonna happen. I will try to shorten the code using examples... After writing the blow code.. it may be really confusing. I have stuck the file on my server http://www.empiresolutions.net/clients/zell/green_bar.zip in case anybody whats to get a better look. This file in it current state works fine, just is slow. Any and all help is so appreciated.

Another Question... Can anyone provide suggestions on how to bench-test my sql scripts to see exact improvment speeds?

Each indent means the following query is nested.

Expand|Select|Wrap|Line Numbers
  1. Query 1 (2 Join Tables)
  2.  
  3. Query 2 (2 Join Tables)
  4.  
  5. Query 3 (1 Table)
  6.  
  7. Query 4 (4 Join Tables, While Loop)
  8.  
  9.     Query 5 (2 Join Tables)
  10.  
  11.     Query 6 (1 Table)
  12.  
  13. Query 7 (4 Join Tables, While Loop)
  14.  
  15.     Query 8 (2 Join Tables)
  16.  
  17.     Query 9 (1 Table)
  18.  
  19. Query 10 (1 Table, While Loop)
  20.  
  21.     Query 11 (2 Join Tables, Calls every 10 rows from Query 10)
  22.  
  23.     Query 12 (2 Join Tables, Calls every 10 rows from Query 10, same as Query 11 basically)
  24.  
  25.     Query 13 (2 Table, While Loop)
  26.  
  27.         Query 14 (1 Table)
  28.  
  29.         Query 15 (2 Join Tables, This query and subs are called 4 times in a FOR loop)
  30.  
  31.             Query 16 (2 Join Tables)
  32.  
  33.             Query 17 (2 Join Tables)
  34.  
  35.                 Query 18 (1 Table)
  36.  
  37.             Query 19 (2 Join Tables)
  38.  
  39.                 Query 20 (1 Table)
  40.  
Feb 11 '07 #1
1 1704
ronverdonk
4,258 Expert 4TB
Have you ever used the MySQL EXPLAIN function as a way to obtain information about how MySQL executes a SELECT statement?

That way you can get information on your queries. See Optimizing queries with EXPLAIN

Ronald :cool:
Feb 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: leegold2 | last post by:
Not sure if I should post in php or sql, $query = "SELECT page.*, url_pages.* FROM `page` LEFT JOIN `keywords` USING(`page_id`) LEFT JOIN URL_PAGES USING (`page_id`) WHERE...
2
by: Brian | last post by:
Hello I am using version 4.0.12-nt of MySQL and when I hit the enter key rapidly I can't connect to the database. The result is a message is returned to me from mysql that says I can't connect...
0
by: George | last post by:
Hi, The storeprocedure fails with null exception on the DB2 development centre for SELECT querys for all tables that has the number of columns greater than 10. Strange ,but true ..i reinstalled...
0
by: Stu | last post by:
I have a few FrontPAGE 2002 Webs running on Windows 2003 Servers and IIS. My webs use ASP (classic) pages that display data pulled from the Access databases using the FrontPage database results...
2
by: Merja | last post by:
Is there a quick and easy way to locate tables/querys in the relationships view? If you have over 100 tables in your database it usually takes a long time before you find something in the...
6
by: dale zhang | last post by:
Hi, I build a web form with a 4-cell table on the top (flawlayout), followed by some labels and textboxes (gridlayout). The web form is displayed well in dell m60 laptop with all resolution...
3
by: Stephen Preston | last post by:
I can't get an $array to be used as a select query on a mySQL database. I have a 'parts list' which displays on a page (works fine) and is a form. At the end of each row is a input type='text'...
4
by: Jack | last post by:
Hi, I have the following Access DDL statment from which I generated a access table: CREATE TABLE TEST1 (ID COUNTER, NAME TEXT(50), STORAGESPACEASSIGNED TEXT(50) )
3
by: Chifo | last post by:
hello. i have a problem with a populate html table with data from table here it's the problem two querys retrieving data from table, one of querys show me a colletion of data from 6:00 am to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.