![]() |
| Sponsored Links (We share ad revenue): |
|
|
Re: Should be 'date' be normalised? |
|
Ultra Talker
Latest Blog Post:
Web Development Business Tips Posts: 390
|
I haven't been creating databases for a real long time, so take what I have to say with a grain of salt. Personally, I don't think I would normalize a date field, especially when you have the date applied to completely different types of data like news and guestbook entries. If you're using any sort of time stamp, it wouldn't make sense because no two entries would share the same date. As I understand normalization, the whole purpose is to optimize the database by cutting down on duplication. If no duplication occurs, however, you're just creating extra work for yourself.
|
|
|
|
|
|
Re: Should be 'date' be normalised? | ||
|
Fetchez la vache!
Latest Blog Post:
Pretty pretty please…. Posts: 1,689
Name: Thierry
Location: In the void
|
Quote:
Putting those in a separate table with FK referencing them will add nothing but overhead. Your "time" table will grow, and each time you will need to look up for that time, you will have to scan the indexes. And a simple reminder: the more datas a table contains, the more time the indexes needs to be parsed. It can reache a state where a sequential read is faster than an index scan. http://www.mysqlperformanceblog.com/...-where-column/ Quote:
I learned it not so long ago myself. In the case of a timestamp, I almost always find it to be relative to the information I write in my table, so I keep them together.
__________________
Listen to the ducky: "This is awesome!!!" Last edited by tripy : 04-29-2008 at 11:40 AM. |
||
|
|
|
|
|
Re: Should be 'date' be normalised? |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,068
Name: John Alexander
|
I would normalize events, but not dates. If lots of things correspond to the same point in time, something important enough to earn a name, that makes sense to describe in terms of PK and FK relationships. Say an election, or a software release.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
|
|
Re: Should be 'date' be normalised? | ||
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,068
Name: John Alexander
|
Quote:
Quote:
Plus, every time you change data on a keyed field, the index(es) that reference it are updated as part of that transaction. So delete, insert, and update commands all slow down for the presence of an index. Unless, of course, the update benefits from being able to find the row(s) to change.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
||
|
|
|
| Sponsored Links (We share ad revenue): |
| Thread Tools | |
|
|
| Webmaster Resources Marketplace: |
| Software Development Company | Webhosting.UK.com |
| Web Templates | Text Link Brokers | Stock Photos |