On Oct 4, 2013, at 10:01 AM, Chuck Hill wrote:

Hi Mark,


On 2013-10-04 9:09 AM, "Mark Wardle" wrote:

Hi all,

When I originally planned the schema used for our clinical application, I used horizontal inheritance. As use has increased, I perceive that horizontal inheritance will not scale for more and more entities. Perhaps I should spend time measuring the performance impact, but I am planning on ever increasing the number of child entities (they act as data collection forms) and so I think single-table inheritance is a better fit.

Yes, it is.

Not to contradict Chuck (he is always right), but how much data are you expecting?

Specifically, if you are stuffing gigabytes of data into a single table you can get to the point where your table and/or indexes will no longer fit into memory. Once that happens, your performance falls off a cliff as it depends on the IO speed of the disks instead of RAM. When that happens, it is sudden and very unwelcome. 

To illustrate, you can see in this graph that somewhere between 30 and 45 GB, Postgresql 9.2.4 performance drops from handling 12000 selects per second to less than 3000. No surprise, this is on a new database with 48GB of memory.


I think horizontal inheritance would have a natural advantage in the case where you have many gigabytes of data to store and you are generally fetching against only one of those tables. 


Ramsey



I have two questions.

1. Is there an easy way of migrating? I can see that I could set-up a wholly new type of entity / sub entities and then manually migrate old entity data into the new ones. This sounds like a considerable piece of work.

You should be able to migrate the model fairly painlessly.  For the data, I think you will end up with a script of INSERT INTO … VALUE SELECT FROM statements.


2. What happens in single-table inheritance if you have a clash of property names but the column name is different (or for that matter the same).

I think that should be OK.   EOs can't change entity type so EOF should do the right thing for each sub-entity in terms of moving data to and from the columns.

Chuck


-- 
Chuck Hill             
Executive Managing Partner, VP Development and Technical Services

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.    

Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! 

Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com

This email sent to rgur...@smarthealth.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to