Bug 780092 (SOA-2459) - ModeShape does not create indices for JPA connector during db initialization - possible performance problem?
Summary: ModeShape does not create indices for JPA connector during db initialization ...
Keywords:
Status: CLOSED NOTABUG
Alias: SOA-2459
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: EDS
Version: 5.1.0.ER3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: ---
Assignee: Default User
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-22 10:36 UTC by Jiri Pechanec
Modified: 2010-10-22 11:58 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-22 11:58:31 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-2459 0 Blocker Closed ModeShape does not create indices for JPA connector during db initialization - possible performance problem? 2013-08-05 05:46:45 UTC

Description Jiri Pechanec 2010-10-22 10:36:17 UTC
project_key: SOA

modeshape/tools/PostgreSQL/create.modeshape-jpa-connector.ddl contains following DDL commands to create database for JPA connector

create table DNA_NAMESPACES (id int8 not null, URI varchar(512), primary key (id))
create table DNA_WORKSPACES (id int8 not null, NAME varchar(128) not null, primary key (id))
create table MODE_OPTIONS (NAME varchar(128) not null, VALUE varchar(512) not null, primary key (NAME))
create table MODE_SIMPLE_LARGE_VALUES (SHA1 varchar(40) not null, COMPRESSED bool, DATA oid not null, LENGTH int8 not null, TYPE varchar(255) not null, primary key (SHA1))
create table MODE_SIMPLE_NODE (ID int8 not null, ALLOWS_SNS bool not null, CHILD_NAME_LOCAL varchar(512), COMPRESSED bool, DATA oid, CHILD_INDEX int4 not null, NODE_UUID varchar(36) not null, NUM_PROPS int4 not null, ENFORCEREFINTEG bool not null, SNS_INDEX int4 not null, WORKSPACE_ID int8 not null, CHILD_NAME_NS_ID int8, PARENT_ID int8, primary key (ID))
create table MODE_SUBGRAPH_NODES (ID int8 not null, DEPTH int4 not null, CHILD_NUM int4 not null, UUID varchar(36) not null, PARENT_NUM int4 not null, QUERY_ID int8 not null, primary key (ID))
create table MODE_SUBGRAPH_QUERIES (ID int8 not null, ROOT_UUID varchar(36) not null, WORKSPACE_ID int8 not null, primary key (ID))
create table ModeShape_LARGEVALUE_USAGES (ID int8 not null, largeValues_SHA1 varchar(40) not null)
create index NS_URI_INX on DNA_NAMESPACES (URI)
create index WS_NAME_INX on DNA_WORKSPACES (NAME)
create index CHILDINDEX_INX on MODE_SIMPLE_NODE (WORKSPACE_ID, PARENT_ID, CHILD_INDEX)
create index CHILDNAME_INX on MODE_SIMPLE_NODE (WORKSPACE_ID, PARENT_ID, CHILD_NAME_NS_ID, CHILD_NAME_LOCAL, SNS_INDEX)
create index NODEUUID_INX on MODE_SIMPLE_NODE (WORKSPACE_ID, NODE_UUID)
alter table MODE_SIMPLE_NODE add constraint FKE43E2BD346EF783F foreign key (CHILD_NAME_NS_ID) references DNA_NAMESPACES
alter table MODE_SIMPLE_NODE add constraint FKE43E2BD360F39011 foreign key (PARENT_ID) references MODE_SIMPLE_NODE
create index QUERYID_INX on MODE_SUBGRAPH_NODES (QUERY_ID, UUID, DEPTH)
alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DAE58CEC5C foreign key (ID) references MODE_SIMPLE_NODE
alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DA1B6FBC1C foreign key (largeValues_SHA1) references MODE_SIMPLE_LARGE_VALUES
create sequence hibernate_sequence

During ModeShape startup the indices are not created, the log contains only
2010-10-22 12:27:55,676 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table DNA_NAMESPACES (id int8 not null, URI varchar(512), primary key (id))
2010-10-22 12:27:55,834 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table DNA_WORKSPACES (id int8 not null, NAME varchar(128) not null, primary key (id))
2010-10-22 12:27:55,884 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SIMPLE_LARGE_VALUES (SHA1 varchar(40) not null, COMPRESSED bool, DATA oid not null, LENGTH int8 not null, TYPE varchar(255) not null, primary key (SHA1))
2010-10-22 12:27:55,933 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SIMPLE_NODE (ID int8 not null, ALLOWS_SNS bool not null, CHILD_NAME_LOCAL varchar(512), COMPRESSED bool, DATA oid, CHILD_INDEX int4 not null, NODE_UUID varchar(36) not null, NUM_PROPS int4 not null, ENFORCEREFINTEG bool not null, SNS_INDEX int4 not null, WORKSPACE_ID int8 not null, CHILD_NAME_NS_ID int8, PARENT_ID int8, primary key (ID))
2010-10-22 12:27:56,008 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SUBGRAPH_NODES (ID int8 not null, DEPTH int4 not null, CHILD_NUM int4 not null, UUID varchar(36) not null, PARENT_NUM int4 not null, QUERY_ID int8 not null, primary key (ID))
2010-10-22 12:27:56,057 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SUBGRAPH_QUERIES (ID int8 not null, ROOT_UUID varchar(36) not null, WORKSPACE_ID int8 not null, primary key (ID))
2010-10-22 12:27:56,107 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table ModeShape_LARGEVALUE_USAGES (ID int8 not null, largeValues_SHA1 varchar(40) not null)
2010-10-22 12:27:56,115 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table MODE_SIMPLE_NODE add constraint FKE43E2BD346EF783F foreign key (CHILD_NAME_NS_ID) references DNA_NAMESPACES
2010-10-22 12:27:56,123 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table MODE_SIMPLE_NODE add constraint FKE43E2BD360F39011 foreign key (PARENT_ID) references MODE_SIMPLE_NODE
2010-10-22 12:27:56,140 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DAE58CEC5C foreign key (ID) references MODE_SIMPLE_NODE
2010-10-22 12:27:56,148 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DA1B6FBC1C foreign key (largeValues_SHA1) references MODE_SIMPLE_LARGE_VALUES
2010-10-22 12:27:56,156 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create sequence hibernate_sequence
2010-10-22 12:27:56,165 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) schema update complete

And the database does not contain indices, see
soaesb1=> \di
                                  List of relations
 Schema |             Name              | Type  |  Owner  |          Table           
--------+-------------------------------+-------+---------+--------------------------
 public | dna_namespaces_pkey           | index | soaesb1 | dna_namespaces
 public | dna_workspaces_pkey           | index | soaesb1 | dna_workspaces
 public | mode_options_pkey             | index | soaesb1 | mode_options
 public | mode_simple_large_values_pkey | index | soaesb1 | mode_simple_large_values
 public | mode_simple_node_pkey         | index | soaesb1 | mode_simple_node
 public | mode_subgraph_nodes_pkey      | index | soaesb1 | mode_subgraph_nodes
 public | mode_subgraph_queries_pkey    | index | soaesb1 | mode_subgraph_queries
(7 rows)


Morevover why ModeShape_LARGEVALUE_USAGES does not contain primary key?

Comment 1 Jiri Pechanec 2010-10-22 11:58:31 UTC
The issue is present only if parameter mode:autoGenerateSchema is set to update


Note You need to log in before you can comment on or make changes to this bug.