naykidd Posted July 24, 2009 Share Posted July 24, 2009 Hi i've created a MySql table which consists of about 10 columns, and im about to start populating it with around 15,000+ entries.. The contents of this table are fetched by PHP and different results from the table are displayed on different pages of my site, depending on a certain branding (E.g. a page for bosch, a page for sony, a page for sanyo, but all coming from the same table, which will use a search feature to fetch the relevant information into each page) As its a website, obviously likely that all pages (About 40 brands) would be looked at at the same time by many many people Is this going to be very slow? If so is it going to be much slower than if i split the tables up into 40 different brands? Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/ Share on other sites More sharing options...
Zyx Posted July 24, 2009 Share Posted July 24, 2009 No, you should not definitely create different tables for each brand, becuase you would break lots of database design rules. It's is hard to say, whether it will be slow or fast without any piece of the source code, becuase it depends, how you are going to optimize it. My suggestions: 1. Use MySQL indexes properly. 2. Use some sort of pagination in order not to display too many rows on one page. 3. Use unbuffered queries when fetching the data. The original PHP mysql extension buffered all the results in memory and then fetched them from a local memory. It allowed to simulate recursive queries, but it was very inefficient. PDO is much better choice in my opinion. Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-881777 Share on other sites More sharing options...
ignace Posted July 24, 2009 Share Posted July 24, 2009 Both PHP and MySQL is known to be able to handle a serious amount of users and if both properly optimized you can serve an even more serious amount of users. However chances are that within the first year you won't see that many people online, maybe not even in the first 5 years (depending on findability and marketing). A lot of companies invest in a certain amount of servers which would be able to handle that serious load. However there are very few companies who experience that serious load within the first year (because their user base is only starting to expand), second year is more probable (as you'll already have a user base and returning users). Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-881784 Share on other sites More sharing options...
Abhi2k5 Posted July 24, 2009 Share Posted July 24, 2009 if your record fixed in database you may use xml. if not then check your php loop how many time excuted or check ur query Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-881785 Share on other sites More sharing options...
ignace Posted July 24, 2009 Share Posted July 24, 2009 3. Use unbuffered queries when fetching the data. The original PHP mysql extension buffered all the results in memory and then fetched them from a local memory. It allowed to simulate recursive queries, but it was very inefficient. PDO is much better choice in my opinion. What has PDO to do with mysql buffering it's queries? PDO stands for PHP Data Objects and is an database abstraction layer (thus making your application only portable across multiple databases vendors). Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-881787 Share on other sites More sharing options...
Psycho Posted July 24, 2009 Share Posted July 24, 2009 PDO stands for PHP Data Objects and is an database abstraction layer ... From the manual PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility. Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-881794 Share on other sites More sharing options...
Zyx Posted July 24, 2009 Share Posted July 24, 2009 ignace -> I know what PDO is. And PDO, as a data-access layer, uses unbuffered queries only, contrary to the historically first PHP mysql extension, where such option appeared in PHP 4 and many programmers simply don't know about it, still using ordinary mysql_query() function, even if they don't need the buffering features. Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-881795 Share on other sites More sharing options...
ignace Posted July 24, 2009 Share Posted July 24, 2009 ignace -> I know what PDO is. And PDO, as a data-access layer, uses unbuffered queries only, contrary to the historically first PHP mysql extension, where such option appeared in PHP 4 and many programmers simply don't know about it, still using ordinary mysql_query() function, even if they don't need the buffering features. I didn't knew that, I really thought all PDO did was to provide database portability. Well, you really learn something new everyday Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-881812 Share on other sites More sharing options...
waynew Posted July 24, 2009 Share Posted July 24, 2009 ignace -> I know what PDO is. And PDO, as a data-access layer, uses unbuffered queries only, contrary to the historically first PHP mysql extension, where such option appeared in PHP 4 and many programmers simply don't know about it, still using ordinary mysql_query() function, even if they don't need the buffering features. As far as I'm aware, buffering options are available to programmers for the PDO. But they're not enabled by default. PDO will NOT make your queries faster. In fact, it is actually slower than mysql_query. Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-882341 Share on other sites More sharing options...
gabasc09 Posted August 13, 2009 Share Posted August 13, 2009 As far as I'm aware, buffering options are available to programmers for the PDO. But they're not enabled by default. PDO will NOT make your queries faster. In fact, it is actually slower than mysql_query. May i know to what extent is mysql_query slower than PDO. And may i ask what exactly PDO does and how does it differ from mysql_query. I tried re-reading this topic, but couldn't get the notion of PDO So will someone please elaborate on whatever is being discussed here. *thank you* Quote Link to comment https://forums.phpfreaks.com/topic/167241-the-speed-of-php/#findComment-897080 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.