473,289 Members | 1,884 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,289 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 1702
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.