in reply to Re: SQL database architecture
in thread SQL database architecture
Addtitionally, I wouldn't guarantee that there is a significant performance gain in what you describe (squeezing what *should* be an extender-table into columns of a table). Why do I refute the claims to increased performance? Well, I'll break it down into the two main components for database performance: CPU time and I/O (either disk or buffer).
CPU: you're adding the same number of values, either way... by adding 1 out of 50 values in 50 times as many rows, or adding one value for each row (but only 1/50th the number of rows)... it's all the same amount of time spent summarizing whatever data you are querying.
I/O: it's important to understand how databases organize data on disks (and bear in mind that I/O buffers in memory usually mirror the disk structure... just faster, so keep in mind that what I say about disks is pretty much applicable to ram buffers, too). They do so by sticking rows of the table, packed one against another, onto disk blocks. The "wider" the row (that is, the more bytes it takes to store all of the row-data) the fewer rows can fit on any one disk block. The limiting factor in terms of I/O (again, whether from disk or buffer) is the number of blocks that have to be read. If the table is 50 times wider, and 1/50th the number of rows, it will occupy roughly the same number of disk blocks, and therefore, it will take just as long to read in the whole table.
Of course, if the query is highly directed and can make use of indexes, then, again, there's no performance difference.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: SQL database architecture
by graff (Chancellor) on Nov 04, 2003 at 05:37 UTC | |
by tilly (Archbishop) on Nov 04, 2003 at 06:45 UTC | |
by etcshadow (Priest) on Nov 04, 2003 at 06:07 UTC |