Jump to content

Multiple SQL queries


Nile

Recommended Posts

Hey, simple question here (I think):

 

I'm experimenting with jquery ajax to perform sql queries through php for a little game. I need these to be fast, and it's executing quite a few queries. Having said that, is it faster to send all the data to one file to perform all of these queries, or instead have mutliple php files all performing their own unique query. The benefit I can see in the latter option is that the queries would be asynchronous; however, it would require more connections to php files.

 

Any feedback would be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/241233-multiple-sql-queries/
Share on other sites

It'll be easier on your server to build up a few seconds worth of queries and execute them within a single mysql connection.

 

You'll lose out on responsiveness though.

 

Your best bet is to code it so you have the option to poll up a few queries. Have it so if you set the time to 0, it executes them immediately, otherwise it waits x seconds to allow queries to build up.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.