Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Too Many Mysql Queries?, is it bad?
arcticsnpr
post May 23 2006, 06:01 AM
Post #1


Newbie [Level 2]
**

Group: Members
Posts: 27
Joined: 5-April 06
Member No.: 21,363



I know that querying the database multiple times in a script is bad, because it uses bandwidth. But what if you have practically unlimited? If you have too, is it ok to have many queries in one script?
Go to the top of the page
 
+Quote Post
Spectre
post May 23 2006, 11:35 AM
Post #2


Privileged Member
*********

Group: Members
Posts: 873
Joined: 30-July 04
Member No.: 246



Hmm... I think you're a little confused. Assuming your MySQL host and web host share the one server (or at least, are on the one local network), it won't use any bandwidth no matter how many queries you execute, because the traffic never leaves the network and therefore is not counted. It's not until you start sending data to a user from your server that it will start to eat away at the bandwidth.

You can have as many queries as you like in a script. The only real limitation you may face is speed - if you attempt to execute a large number of complex SQL queries in one go, the server may take a while to process them and begin to slow down, particularly if you have very large databases. This may present something of a problem if your script carries out a lot of queries.

The only related problem I can think of is the number of connections a single MySQL host can handle at any one time. This is particularly a problem on shared webhosts that host thousands and thousands of different sites, all of which could be attempting to access a single MySQL host at any given time (some long-term members of Trap17 may have seen this issue raised before). Poor coding practises can also lead to trouble, such as failing to clear query memory, close connections, etc.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Need Advice On Setting Up Mysql Database.(4)
  2. Quick Question(10)
  3. Mysql Database Size(7)
  4. Mysql Hacks(1)
  5. Import From Excel File Into Mysql Database(11)
  6. Creating A Php Login System Using Mysql(10)
  7. Mysql Database Not Working(3)
  8. Mysql Database Setup : Setting Up Mysql Database(6)
  9. The Only Reason I Choose Ms Sql Server Rather Than Mysql(0)
  10. Mysql Db Is Down Getting Following Error(2)
  11. Subquery In Mysql(5)
  12. It Went Well For A While(5)
  13. Increment A Mysql Column(7)
  14. Complete Login System(57)
  15. Mysql, Php, Apache Downloads And Setup Was A Nightmare(10)
  1. Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom)(41)
  2. Database With Mysql++(7)
  3. Html Form!(4)
  4. Mysql Won't Update(4)
  5. How Do I Find My Mysql Password? [resolved](5)
  6. Mysql-essential-5.0.51 Installion Problem(2)
  7. Please Explain Me Mysql(4)
  8. Remote Access Mysql(8)
  9. Is It Possible To Access The Mysql Remotely?(10)
  10. Check Referrer To Prevent Linking Yours From Other Sites(8)
  11. Create Table - Mysql Code - Help(1)
  12. Tools Needed!(9)
  13. Mysql(2)
  14. Mysql Error(3)
  15. Mysql + Php Question(5)


 



- Lo-Fi Version Time is now: 10th October 2008 - 06:50 PM