iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-13-2004, 04:55 PM
WebProWorld Member
 
Join Date: Nov 2003
Location: Bedford, Va.
Posts: 72
wmabear54 RepRank 0
Default Speed of MYSQL and PHP

What are the main factors and combined sub factors that will effect the speed at which pages will load using php to call and mysql to deliver multible queries(between 100 and 500 per page). I am at the point in my project where I am ready to write code and create the tables. Are there any specific places to look for answers. I have been looking at mit.edu
site for more answers. Am I way off base or are these things I should be thinking about at this point.

Thanks in advance for input and opinions.
Mike
Reply With Quote
  #2 (permalink)  
Old 09-13-2004, 09:17 PM
redcircle's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Grand Rapids, MI USA
Posts: 425
redcircle RepRank 0
Default

Is there a reason you need so many queries? Most information can be extracted with a handful of well crafted queries. mysql.com would be a place I'd look. also read up on database normalization and optimization. If you need any help just ask.
__________________
www.squitosoft.com - PHP development site. featuring Squito Gallery. a php driven photo gallery.
www.rgfx.net - Specializing in Internet solutions, including Html authoring, Interactive Web sites, 3D/2D Graphics and animation.
Reply With Quote
  #3 (permalink)  
Old 09-14-2004, 02:23 AM
mushroom's Avatar
WebProWorld Pro
 
Join Date: Feb 2004
Location: Queen Charlotte B. C. Canada
Posts: 287
mushroom RepRank 0
Default

Quote:
Originally Posted by redcircle
Is there a reason you need so many queries?
1 query can return 100's of results, the trick is to build your tables with the querys you are going to run against them in mind.
__________________
Irony: That for most people the most "trusted" web site on the planet is for a company the has been convicted of criminal activity.

Both Security and SuSe start with "S". www.oldslides.com
Reply With Quote
  #4 (permalink)  
Old 09-14-2004, 07:51 AM
WebProWorld Pro
 
Join Date: May 2004
Location: United Kingdom
Posts: 151
php~pro RepRank 0
Default

How long is a piece of string is the answer. As with anything there are so many variables to take into account. Server type, server speed, connection speed, and the code itself. It depend entirely on how your code is scripted and what functions are used. As just one simple example read the php manual on ereg and preg funtions. Similar function yet preg is a whole load faster. Code execution times can be dramatically reduced by a thoughtfull approach.
Reply With Quote
  #5 (permalink)  
Old 09-14-2004, 01:41 PM
WebProWorld Member
 
Join Date: Nov 2003
Location: Bedford, Va.
Posts: 72
wmabear54 RepRank 0
Default

Hi Redcircle, mushroom and php~pro

I meant to say results not queries. There are places in the site when finished, that will have some sub_catagories with up to 125 or more products in them, each product will be displayed with for example product_id, thumbnail, name or title of product, description, price and so forth. On that same page I will issue another query that will fill in page title, meta_description and meta_keywords. The third query would be to fill in links for related items.
That is why I am concerned with the load time.
By the way what is object oriented programming, is it where you bundle multible results together and put them all ready to go into there own table.
I will look into preg as the better function.
Reply With Quote
  #6 (permalink)  
Old 09-14-2004, 04:58 PM
WebProWorld Pro
 
Join Date: May 2004
Location: United Kingdom
Posts: 151
php~pro RepRank 0
Default

Preg was merely an example of how php function differ in execution time.

With regards running out 100 products to a single page, you are likely to annoy your custmers with some major scrolling. Divide the results and split them into more managable amounts. Use paging to provide numbered page links, or allow the customer to narrow their queries right down to a very suitable item.
Reply With Quote
  #7 (permalink)  
Old 09-20-2004, 04:03 PM
WebProWorld New Member
 
Join Date: Aug 2004
Location: Tennessee
Posts: 22
poolpartsetc RepRank 0
Default

If you are working with 100 results from a query, it should not take too long. I agree with the above, if you are showing 100 items per page, that is too many. You can write a query to return say 10 results.

SELECT * FROM table LIMIT 0,10
__________________
Swimming Pool World | Pool Parts Etc
Reply With Quote
  #8 (permalink)  
Old 09-21-2004, 08:03 PM
WebProWorld New Member
 
Join Date: Feb 2004
Location: Brookston Indiana
Posts: 2
refrost RepRank 0
Default php/mysql speed

wmabear54,

I have and continue to wonder about that question and concern, wondering how fast something will be. You may be surprised to see what happens when you just go ahead and program it as see if you can live with the outcome.

I'm afraid I often resorting to "whatever I can figure out" which often means many queries in building a page. In some cases I probably should go back and be more efficient, but....

For example, see http://www.twinrockerhandmadepaper.c...s&grp=Pigments

IIRC, there are 2 queries for each of the 72 "click price to add to cart" links in the pigments table, plus a handful more to rebuild the menus.

It doesn't take too long (imo) to create that page. A lot less than dragging up images.

My point is that php/mysql is pretty fast. Faster than one first think. Go ahead and program it. Probably it will be alright.

{And, yeah, I'm always open for encouragement or suggestions on how to make that table/page faster.]

Good luck,

refrost[/url]
Reply With Quote
  #9 (permalink)  
Old 09-22-2004, 04:38 AM
WebProWorld Pro
 
Join Date: May 2004
Location: United Kingdom
Posts: 151
php~pro RepRank 0
Default

I dont think that was what wmabear was exactly asking.

Quote:
deliver multible queries(between 100 and 500 per page)
Your page is just 2 queries looped in simple recursion like a link directory.

To further answer your query wmabear if you do need this number of queries you would be faster making the query from inside the loop and drawing a result for each succession. My advice is definetly go with pagination to break page sizes down, and create a multi tier css child menu to work with MySQL to refine query size from menu. Everybody wants everything now in this world Im afraid.
Reply With Quote
  #10 (permalink)  
Old 09-22-2004, 10:57 PM
WebProWorld Member
 
Join Date: Nov 2003
Location: Bedford, Va.
Posts: 72
wmabear54 RepRank 0
Default SPEED

PHP~PRO
Thanks for the tips on making faster querys they will come in handy at some point. You knew exactly what I wanted to know. But I am working on just getting things to work right now. Back to the basics again.

And welcome to the forum's Refrost

Mike
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum

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



All times are GMT -4. The time now is 12:56 AM.



Search Engine Optimization by vBSEO 3.3.0