473,385 Members | 1,341 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,385 software developers and data experts.

Which one is best ?

Currently I have 3 mysql tables with about 6 columns each, sometimes I have
to access to all of them at the same time but most of the times I access 2
at the same time.

I was wondering which is fast making a single table with about 18 columns,
and each time select the columns that I want in the select query, this way I
would do less select queries.
Or is it better like I have 3 tables, and access 2 of them at the same time
most of the times?

Probably I should post this in a MySQL news server, anyway if someone has
some thoughts about it don't be shy ;)

Thx
Marco
Jul 17 '05 #1
3 1687
Marco wrote:
I was wondering which is fast making a single table with about 18 columns,
and each time select the columns that I want in the select query, this way I
would do less select queries.
Or is it better like I have 3 tables, and access 2 of them at the same time
most of the times?


There is no simple yes or no answer to it, it depends much about what
kind of queries you need to make and how many rows you are supposed to
have in each table.

For example:
If you have 100 000 rows in all tables, and all rows are linked 1 and
only 1 row in other tables, you propably would be better putting all in
one table.

Then again, if you have table with 100 000 rows and another table with
about 10 rows, and each row has a string that you want to do a query
like: select * from nametable where name like '%middletext%';

It would be faster to use different tables. Because if you would have 1
table, you would have to search all rows in it, because you couldn't
benefit from indexes. But when using two tables, you would find the
names by searching 10 rows and then you could use name_id in your larger
talbe, which would be of course indexed.

These are only two examples, but I hope you understant what I'm trying
to say: There is no simple answer to this question.
Jul 17 '05 #2
MySQL is a relational database it is designed to be fast with multiple table
accesses. I have queries that access 5 tables at once. It is still fast.

If you can do the query in a simple wide table... you really don't need a
relational database.

"Marco" <mpgtlatbluewindotch> wrote in message
news:40**********@news.bluewin.ch...
Currently I have 3 mysql tables with about 6 columns each, sometimes I have to access to all of them at the same time but most of the times I access 2
at the same time.

I was wondering which is fast making a single table with about 18 columns,
and each time select the columns that I want in the select query, this way I would do less select queries.
Or is it better like I have 3 tables, and access 2 of them at the same time most of the times?

Probably I should post this in a MySQL news server, anyway if someone has
some thoughts about it don't be shy ;)

Thx
Marco

Jul 17 '05 #3
Marco wrote:
Currently I have 3 mysql tables with about 6 columns each, sometimes I have
to access to all of them at the same time but most of the times I access 2
at the same time.

I was wondering which is fast making a single table with about 18 columns,
and each time select the columns that I want in the select query, this way I
would do less select queries.
Or is it better like I have 3 tables, and access 2 of them at the same time
most of the times?

Probably I should post this in a MySQL news server, anyway if someone has
some thoughts about it don't be shy ;)

Thx
Marco


I've always leaned toward implementing a more highly normalized (more
granularized) form. The DB developers I've worked with all lean towards
this approach as well.

In the past I've seen how easily I could have "shot myself in the foot"
if I hadn't normalized. Here are some links to articles I thought were
pretty decent:
http://www.serverwatch.com/tutorials...le.php/1549781
http://www.sqlmag.com/Articles/Index...leID=4887&pg=1

http://www.devshed.com/c/a/MySQL/An-...Normalization/

Regards,

- Dan
http://www.dantripp.com/
Jul 17 '05 #4

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

Similar topics

9
by: CY FOK | last post by:
Hi I am planning to open a software company to develop client-server apps and web applications for my client. Now, i am in a difficult situation to determine what is the best platform i should use...
1
by: JJ | last post by:
Hi, I was going to buy a server with Raid 1 as I thought that it meant that if one of the two mirrored drives fail, you simply take it out and put a new one in. At which point presumably the...
3
by: Balaji Kannan | last post by:
Hi, In dot net during component development i have used some member variables in the class file. Inside the class i have used the member declaration and the instant handling in the following...
17
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher ...
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
24
by: invitro81 | last post by:
Hello I've recently learnt python and I do love it! I congratulate all those geeks who produce this nice language; well, because I could be called a nearby newbee I've decided to improve my...
3
by: ram_palavalasa | last post by:
Hi all, Whichone is the best among the following while proessing the data? ODBC,DAO,ADO,OLEDB...please justify urself why ? also let me know how to loas dll component to the workspace in...
16
by: John Salerno | last post by:
My initial feeling is that concatenation might take longer than substitution, but that it is also easier to read: def p(self, paragraph): self.source += '<p>' + paragraph + '</p>\n\n' vs. ...
5
nehashri
by: nehashri | last post by:
hi can ne1 plz guide me as to which interface is best for posgresql. i have started using posgrsql recently. i am making a biological database which has a frontend allowing the user to select...
103
by: Tom | last post by:
How do we get out of the browser infinite loop quicksand when we navigate to web pages designed to lock us in and force us to hit the "pay me" button (whatever they want to force you to do)? ...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.