hi people,
while i was working on a database i found out that theres a table that takes too much relationships both 1-m and m-1(about 8 potential relations and counting), and it will probably get accessed alot because it will be used in lots of queries, so i have some questions that i need to get answers for them:
1. does the number of relations affect the performance of the database server(mysql)?
2. if yes, how to fix it?
3. its used in searching alot, so does copying the fields in another temporary table that gets updated every day helps in anything??
and yeah:can a primary key be just an int?
table with too many relationships
Started by amrosama, Dec 16 2008 03:37 PM
4 replies to this topic
#1
Posted 16 December 2008 - 03:37 PM
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript
|
|
|
#2
Posted 17 December 2008 - 02:30 AM
1. Yes, if your searching those tables too.
2. Denormailisation if possible
3. What about you archive data that doesnt get searched a lot into an archive table. Say data older than a month or something? Then, searches on data less than a month old will be performed quicker.
4. Yes it can, but you'll have to make sure its unique manually when adding tuples to the table.
HTH
2. Denormailisation if possible
3. What about you archive data that doesnt get searched a lot into an archive table. Say data older than a month or something? Then, searches on data less than a month old will be performed quicker.
4. Yes it can, but you'll have to make sure its unique manually when adding tuples to the table.
HTH
#3
Posted 17 December 2008 - 12:46 PM
+rep
thnx alot for your post
about no.4: doesnt the auto_increment work fine?
thnx alot for your post
about no.4: doesnt the auto_increment work fine?
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript
#4
Posted 18 December 2008 - 01:28 AM
Yes, but it won't be on by default I don't think. You'll have to set it when you create the table. If you set the column to primary key however, it'll do all that by itself.
#5
Posted 20 December 2008 - 07:53 PM
a primary key can not be only auto_increment, as that is just an addition to the field information. the primary key field still neds to have a datatype, and int works just fine.
but usually, you design the primary key to be exactly "int auto_increment"
but usually, you design the primary key to be exactly "int auto_increment"


Sign In
Create Account


Back to top









