![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
So I can see this might lead to performance gains. Is this a common optimization approach? Is it performed with Oracle / PostgreSQL databases ? I would have expected this can be handled better in some other way; maybe with views. |
#3
| |||
| |||
|
|
stephanwehner (AT) gmail (DOT) com wrote: So I can see this might lead to performance gains. Is this a common optimization approach? Is it performed with Oracle / PostgreSQL databases ? I would have expected this can be handled better in some other way; maybe with views. You might want to read about partitioning, a new feature coming in MySQL 5.1 (still in beta). Some other RDBMS implementations have similar features, but since you're using MySQL, this might be of interest to you. http://dev.mysql.com/doc/refman/5.1/...-overview.html It could achieve the benefits you are seeking, by splitting the physical storage without splitting the logical table entity. Regards, Bill K. |
#4
| |||
| |||
|
|
Hi Bill, Thanks for the link. I take it then that is not out-of-the-ordinary to split a table in this manner. I was trying to understand how this is dealt with in other database engines as well. Views don't allow this kind of optimization? Stephan |
#5
| |||
| |||
|
|
I take it then that is not out-of-the-ordinary to split a table in this manner. |
|
I was trying to understand how this is dealt with in other database engines as well. Views don't allow this kind of optimization? |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
This week I came across the same construct the second time, and I am curious whether it is good practice or not. A huge table was factored according to the values in one column, and the value was used as a part of the new table name. Example: Table INFO has columns C1, C2, C3. The values in column C1 are "a", "b", "c",..."z" Create tables INFOa, INFOb, INFOc, .. INFOz with columns C2, C3, of the same type as in table INFO. Table INFOa has the same rows as table INFO where the C1 column has value "a", except the C1 column itself is dropped. And so on for tables INFOb, INFOc,...INFOz. SELECT and UPDATE statements where then constructed on the fly with string concatenation "SELECT C2, C3 from INFO${param} where C2 > 5" for example. Table INFO is not actually present in the database. Now I don't know what to call this, maybe out-of-band-denormalization. The two databases where mysql based. Size 400MB for all the INFO[a-z] tables in one case, 20MB in the other case. So I can see this might lead to performance gains. Is this a common optimization approach? Is it performed with Oracle / PostgreSQL databases ? I would have expected this can be handled better in some other way; maybe with views. Thanks Stephan |
![]() |
| Thread Tools | |
| Display Modes | |
| |