|
From: Adrian P. <ad...@bt...> - 2006-05-09 08:31:34
|
Good day Jorge, Your boss's concern about performance is entirely reasonable - it's bound to be faster to search the ProcessInstance table than to join it with AttributeInstance as many times as there are attribute references in your WHERE clause. The reason for the current design is, of course, to provide a generic, extensible design where the set of process attributes is specified in XPDL rather than being hard-coded in the database schema and the persistence POJOs or POJIs. For any given workflow-enabled application it is likely that there will be a small set of business keys that are always required in order to look up the process for a known business context, so clearly it would be advantageous to introduce a mechanism to support this efficiently. I suppose it would be possible to subclass the ProcessInstanceEJB/ProcessInstanceBean to introduce additional attributes, but there's a couple of places in the code where you'd need to enumerate the new attributes to ensure that the correct SQL is generated for a given predicate. Another approach might be to introduce a user-defined association table or 'request object' containing just the business keys and the processInstanceId. This approach would only require a single join. I believe Hibernate may have the ability to create a logical view which merges physical tables. However, both the above approaches would require some degree of change in the OBE runtime. Also, be aware that OBE parses SQL predicates and re-writes them using parameter markers so that all database activity can be performed using prepared statements. In order to do this the SQL parser needs to be aware of which tables various attributes reside in - adding another table would necessitate changes to this part of the runtime. On the subject of metrics, I do not have any information myself. All I can suggest is that you measure it for yourself and decide whether it's fast enough for your present purposes. Perhaps you could introduce performance enhancements at a later date if it proves necessary? Thanks, Adrian. Adrian Price Architect & Lead The Open Business Engine mailto:adr...@us... "tenax propositi, altiora peto" ________________________________ From: obe...@li... [mailto:obe...@li...] On Behalf Of Jorge Middleton Sent: Monday, May 08, 2006 8:48 PM To: obe...@li...; obe...@li... Subject: [Obe-developer] Re: obe Hello, I write because I need your help. The subject is, that my boss's distrust about the performance relative to search process instance based on attributes's filter. We have 2 attributes that always be in all processes (business attributes) and he says that this attributes must be in ProcessInstance table so the search process is faster. I think that this is true but also it less flexible and restrictive to future's enhanced so I need some statistics data about time of search or something like that. Somebody could give me an advice? Thank in advance Jorge |