谷歌地图从mysql表缓慢映射

I am reading mysql tables and generating an xml file: https://developers.google.com/maps/articles/phpsqlajax_v3

To generate the map, I generate a JSON file.

My database contains several thousand records, this generates 5000+ lines of JSON.

The mysql query result is different depending on many settings, and needs to be accessible from multiple users at same time.

Each time the map is loaded, this json file is parsed, then the map loads in about 3-6 seconds (depend the client device).

Is there a way to speed up this process, or an alternative way to achieve the same result?

Any suggestion is welcome.

// Cédric

I don't see enough detail to give any specific advice, but if I were in a situation like this my first question would be: Is it absolutely necessary to load up the entire 5K lines of JSON each time the map is loaded? What kind of data does the JSON contain that's being needed all at once? The whole point of AJAX is to load parts of resources only as they're resources (and Google Maps is a master at this); I'd look for some way to only load the highest-level or most-immediate data when the map first loads, then load in more as needed later on.