Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda