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.
The only other odd thing is the change to projects: 

There's nothing else that I can see that would cause a problem
deleting instances. Where does the error show up?

Craig

P.S. until Monday, please reply to [EMAIL PROTECTED] in addition to jdo-dev.

On 4/15/06, Michelle Caisse <[EMAIL PROTECTED]> wrote:
  
 -------- Original Message --------
Subject: last issue with completeness test
Date: Sat, 15 Apr 2006 18:51:11 -0700
From: Erik Bengtson <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]

 Hi,

JPOX now passes completeness interface test in my local workspace, but
apparently the tables are not cleaned out completely on tear down. It passes
if
it is the only configuration enabled. Can someone take a look on that?

Here my changes to the schema and metadata files adding discriminator column
to
tables.

Index:
D:/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql
===================================================================
---
D:/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql
(revision
391636)
+++
D:/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql
(working copy)
@@ -130,6 +130,7 @@
 STATE CHAR(2),
 ZIPCODE CHAR(5),
 COUNTRY VARCHAR(64),
+ DISCRIMINATOR VARCHAR(255),
 CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );

@@ -139,6 +140,7 @@
 NAME VARCHAR(32) NOT NULL,
 EMP_OF_THE_MONTH INTEGER,
 COMPANYID INTEGER REFERENCES companies,
+ DISCRIMINATOR VARCHAR(255),
 CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );

@@ -185,6 +187,7 @@
 PROJID INTEGER NOT NULL,
 NAME VARCHAR(32) NOT NULL,
 BUDGET DECIMAL(11,2) NOT NULL,
+ DISCRIMINATOR VARCHAR(255),
 CONSTRAINT PROJS_UK UNIQUE (PROJID),
 CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
Index:
D:/jdo/trunk/tck20/src/sql/derby/applicationidentity/schema.sql
===================================================================
---
D:/jdo/trunk/tck20/src/sql/derby/applicationidentity/schema.sql
(revision
391636)
+++
D:/jdo/trunk/tck20/src/sql/derby/applicationidentity/schema.sql
(working
copy)
@@ -182,6 +182,7 @@
 STATE CHAR(2),
 ZIPCODE CHAR(5),
 COUNTRY VARCHAR(64),
+ DISCRIMINATOR VARCHAR(255),
 CONSTRAINT COMPS_PK PRIMARY KEY (ID)
 );

@@ -190,6 +191,7 @@
 NAME VARCHAR(32) NOT NULL,
 EMP_OF_THE_MONTH INTEGER,
 COMPANYID INTEGER REFERENCES companies,
+ DISCRIMINATOR VARCHAR(255),
 CONSTRAINT DEPTS_PK PRIMARY KEY (ID)
 );

@@ -232,6 +234,7 @@
 PROJID INTEGER NOT NULL,
 NAME VARCHAR(32) NOT NULL,
 BUDGET DECIMAL(11,2) NOT NULL,
+ DISCRIMINATOR VARCHAR(255),
 CONSTRAINT PROJS_PK PRIMARY KEY (PROJID)
 );

Index:
D:/jdo/trunk/tck20/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm
===================================================================
---
D:/jdo/trunk/tck20/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm
(revision
388908)
+++
D:/jdo/trunk/tck20/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm
(working
copy)
@@ -11,6 +11,11 @@

 
 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -43,6 +48,11 @@

 
 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -149,6 +159,11 @@

 
 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -168,6 +183,11 @@

 
 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -188,6 +208,11 @@

 
 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -306,6 +331,11 @@

 
 
+ 
+ 
+ 
+ 
+ 
 
 
 
Index:
D:/jdo/trunk/tck20/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm
===================================================================
---
D:/jdo/trunk/tck20/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm
(revision
388908)
+++
D:/jdo/trunk/tck20/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm
(working
copy)
@@ -10,6 +10,11 @@
 

 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -29,6 +34,11 @@
 

 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -144,6 +154,11 @@
 

 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -164,6 +179,11 @@
 

 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -183,6 +203,11 @@
 

 
+ 
+ 
+ 
+ 
+ 
 
 
 
@@ -224,8 +249,7 @@
 
 
 
- 
- 
+  
 
 
 
@@ -298,6 +322,11 @@
 

 
+ 
+ 
+ 
+ 
+ 
 
 
 



    
  


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to