Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
Is creating multiple tables faster than a single table for MySql

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.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

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 can't declare foreign key constraints.
  • Adding a column, contraint, or index requires changing many tables.
  • The tables are inefficient, because of the proliferation of half-filled pages.
  • Queries over all the data are a nightmare.

You have an entity. Follow the best practice of having one table for that entity.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!