I use MySql to store different google map markers for different cities.
My question is:
Would it be faster if I created different tables for each cities and store the latitude, longitude there. OR would I be fine with creating a single table to store all the markers there, add a city value column and retrieve them by the city name on my website.
If I create a single table I could end up with 300.000+ rows, on the other hand if I create different tables for each cities, I could end up with 500+ tables...
My immediate thought of process would think multiple tables with less rows would be faster, but it will be a huge mess.
Thank you.
No, no, no. Databases are optimized to handle fewer bigger tables, rather than many smaller tables. Maintaining separate parallel tables is a maintenance nightmare. Here are some reasons:
You have an entity. Follow the best practice of having one table for that entity.