473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MySQL design question

I'm creating an application for multiple cities (about 20-50 cities).
I'm not sure whether to use a single table to store for all cities'
items or break each one out into a seperate table for each city.

I know a seperate tables will be faster for searches because there
will be less records but in terms of maintenance it gets a little
messy and hectic as the list of cities will grow.

I guess it all comes down to is, the number of records I would have.
I'm not sure how many records it takes before MySQL starts to slow
down.
Please give me your thoughts.
Thanks.
Jan 24 '08 #1
3 1254
Neeper wrote:
I know a seperate tables will be faster for searches because there will
be less records but in terms of maintenance it gets a little messy and
hectic as the list of cities will grow.
Separate tables will work at a snail's pace if you want to do cross-city
searches.

Keep them in one table. Index any columns that you plan on searching or
sorting by.
I'm not sure how many records it takes before MySQL starts to slow
down.
I dunno -- millions? Depends on many factors.

Just make sure that you use PDO or some other cross-database programming
tool, and avoid MySQL-specific syntax nuances. That way, you can easily
port the application to another database (perhaps even a database cluster)
if your data grows out of control.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 24 days, 21:06.]

CSS to HTML Compiler
http://tobyinkster.co.uk/blog/2008/01/22/css-compile/
Jan 24 '08 #2
Neeper wrote:
I'm creating an application for multiple cities (about 20-50 cities).
I'm not sure whether to use a single table to store for all cities'
items or break each one out into a seperate table for each city.

I know a seperate tables will be faster for searches because there
will be less records but in terms of maintenance it gets a little
messy and hectic as the list of cities will grow.

I guess it all comes down to is, the number of records I would have.
I'm not sure how many records it takes before MySQL starts to slow
down.
Please give me your thoughts.
Thanks.
You'll get much better answers from database experts over in
comp.databases.mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 24 '08 #3
..oO(Neeper)
>I'm creating an application for multiple cities (about 20-50 cities).
I'm not sure whether to use a single table to store for all cities'
items or break each one out into a seperate table for each city.
One table.
>I know a seperate tables will be faster for searches because there
will be less records but in terms of maintenance it gets a little
messy and hectic as the list of cities will grow.
There won't be much of a difference if the tables are properly indexed.
>I guess it all comes down to is, the number of records I would have.
I'm not sure how many records it takes before MySQL starts to slow
down.
Millions.

Micha
Jan 25 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Westcoast Sheri | last post by:
To keep track of how many fruits my visitors buy, I use a mySQL database (2 columns: "fruit" and "quantity")....so can we make these following mySQL queries work somehow? (visitor buys 5...
133
by: jonathan | last post by:
hey all, I realize that this question might pop up from time to time, but I haven't seen it a while and things might of changed, so - Right now (July 2004) how does mysql stand up in...
2
by: kimshapiro100 | last post by:
Question on PhP, MySQL I am thinking of a consumer internet business for which I will have to have a database driven site built. I am thinking of using PhP, MySQL as the main technologies...
175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
39
by: Mairhtin O'Feannag | last post by:
Hello, I have a client (customer) who asked the question : "Why would I buy and use UDB, when MySql is free?" I had to say I was stunned. I have no experience with MySql, so I was left sort...
2
by: moller | last post by:
Im looking in to the possibility of moving from mySQL to an access database. My reasons are: (1) Database is single user. (2) Database local on users PC. (3) Database has only 8 tables where 4...
2
by: ME | last post by:
I am getting: "ERROR SQLBindParameter not used for all parameters" when attempting to run the following code: Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As...
39
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
2
by: Roopesh | last post by:
Hi, In my mod_python project I am using mysql as the database. There is table card in which unique cards are stored. When a user request comes he has to get a unique card. In this situation I want...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.