Hello Craig,
I think that if we have includeSubclasses==true that the WHERE clause
generated by JPOX will OR all possible values of the discriminator
column. Won't that also be sped up by an index on the discriminator
column?
Regards,
Jörg
Craig L Russell schrieb:
Hi Jörg,
Just to be clear: this improves performance only in the case
that you know what specific class you are looking for (you have a
relationship to a specific most-derived subclass) and there is not
another more appropriate index to optimize on. So it's worthless in the
generic query use case because there will typically be a more
restrictive index, and of little value in the navigation case because
you are joining on a foreign key anyway. So it's only useful for a
table scan of a most-derived subclass or superclass Extent with
includeSubclasses==false.
This came out more harshly than I thought it would when I
started. Is there a good use case for indexing the discriminator column?
Regards,
Craig
On Apr 18, 2006, at 9:22 AM, Jörg von Frantzius wrote:
Craig Russell schrieb:
Hi Erik,
It's probably not related to the problem, but why do you declare an
index defined on the discriminator columns in the metadata?
Yes I'm not Erik but still: in our production system we do that to
increase performance of queries. We'd even like to have that by default.
|