Topic: Abstract model for many databases

Hi, I'm new on forum, because really i need help. I read many posts, articles about abstract models, and I don't have idea how to resolve my problem. At beginning I want to note: having five tables managed from one controller is very importand for my app.
So start:
My app is a manufacturing visualisation system, so I have many, many records every hour, so I want to store strings on one table, booleans on other, integers on other, etc. Now I store all values as strings, this is a sueside, it's slow in searching and database size increase very fast.
What I try to do:
Have one base model named Value with child models named StringValue, IntegerValue, etc. In every model has for example method find_sorted_n_values(n), with difference in sorting method in every model, because every datatype is specific for me.

Any Idea how to switching between tables in Value model depending on datatype. And one think more, every value has meter_id, and Meter model stores datatype returned by that meter.

Thanks for any suggestions another than bar and foo solutions.

Last edited by czuczu1024 (2012-11-06 18:41:52)