1 Reply Latest reply on Jun 6, 2017 8:02 AM by Jacob Ilsø

    Basic index usage

    Jacob Ilsø Newbie

      Hi.

       

      I am using ModeShape 5.4.0 together with WildFly 10.1.0 and I experimenting with indexes in ModeShape. I have this in standalone.xml in WildFly:

       

                  <repository name="sw" anonymous-roles="">

                      <file-persistence/>

                      <index-providers>

                          <index-provider name="local" classname="org.modeshape.jcr.index.local.LocalIndexProvider" module="org.modeshape" relative-to="jboss.server.data.dir" path="modeshape/sw/indexes"/>

                      </index-providers>

                      <indexes>

                          <index name="nodetype" provider-name="local" kind="nodetype" node-type="nt:base" columns="jcr:primaryType(STRING)"/>

                      </indexes>

                      <file-binary-storage/>

                  </repository>

       

      and I issue this code:

       

      QueryResult result = session.getWorkspace().getQueryManager().createQuery("SELECT * FROM [nt:base]", Query.JCR_SQL2).execute();

       

      and print out the qeury plan like this:

       

      ((org.modeshape.jcr.api.query.QueryResult)result).getPlan()

       

      I was expecting to see index usage in the query plan. It looks like this though:

       

      Access [nt:base]

        Project [nt:base] <PROJECT_COLUMNS=[[nt:base].[jcr:primaryType], [nt:base].[jcr:mixinTypes], [nt:base].[mode:localName], [nt:base].[mode:id], [nt:base].[mode:depth], [nt:base].[jcr:score], [nt:base].[jcr:path], [nt:base].[jcr:name]], PROJECT_COLUMN_TYPES=[STRING, STRING, STRING, STRING, LONG, DOUBLE, STRING, STRING]>

          Source [nt:base] <SOURCE_NAME=__ALLNODES__, SOURCE_ALIAS=nt:base, SOURCE_COLUMNS=[jcr:isCheckedOut(BOOLEAN), jcr:defaultPrimaryType(STRING), mode:uri(STRING), mode:lockingSession(STRING), jcr:etag(STRING), jcr:created(DATE), jcr:sameNameSiblings(BOOLEAN), jcr:encoding(STRING), jcr:workspace(STRING), jcr:activityTitle(STRING), jcr:mergeFailed(STRING), jcr:frozenMixinTypes(STRING), jcr:isQueryOrderable(BOOLEAN), jcr:lastModifiedBy(STRING), jcr:childVersionHistory(STRING), mode:synchronous(BOOLEAN), jcr:repository(STRING), mode:derivedAt(DATE), jcr:lastModified(DATE), jcr:successors(STRING), jcr:availableQueryOperators(STRING), mode:derivedFrom(STRING), jcr:primaryItemName(STRING), mode:isSessionScoped(BOOLEAN), jcr:frozenUuid(STRING), jcr:isFullTextSearchable(BOOLEAN), jcr:defaultValues(STRING), mode:sharedUuid(STRING), jcr:predecessors(STRING), jcr:content(STRING), mode:projectedNodeKey(STRING), jcr:language(STRING), jcr:valueConstraints(STRING), mode:sha1(STRING), jcr:activity(STRING), jcr:requiredPrimaryTypes(STRING), jcr:baseVersion(STRING), jcr:requiredType(STRING), jcr:autoCreated(BOOLEAN), jcr:isAbstract(BOOLEAN), mode:externalNodeKey(STRING), jcr:hasOrderableChildNodes(BOOLEAN), mode:lockToken(STRING), mode:kind(STRING), mode:alias(STRING), mode:columnTypeName(STRING), jcr:text(STRING), jcr:mimeType(STRING), mode:workspace(STRING), jcr:data(BINARY), jcr:port(STRING), jcr:protected(BOOLEAN), jcr:primaryType(STRING), mode:expirationDate(DATE), jcr:id(STRING), privileges(STRING), jcr:host(STRING), jcr:lifecyclePolicy(STRING), jcr:versionHistory(STRING), jcr:mixinTypes(STRING), jcr:isQueryable(BOOLEAN), jcr:mandatory(BOOLEAN), jcr:lockIsDeep(BOOLEAN), jcr:currentLifecycleState(STRING), jcr:nodeTypeName(STRING), jcr:isMixin(BOOLEAN), name(STRING), jcr:messageId(STRING), jcr:uuid(STRING), jcr:multiple(BOOLEAN), jcr:title(STRING), jcr:onParentVersion(STRING), mode:nodeTypeName(STRING), jcr:supertypes(STRING), jcr:protocol(STRING), mode:propertyName(STRING), jcr:frozenPrimaryType(STRING), jcr:lockOwner(STRING), jcr:createdBy(STRING), jcr:isDeep(BOOLEAN), jcr:hold(STRING), jcr:configuration(STRING), jcr:description(STRING), jcr:statement(STRING), mode:isHeldBySession(BOOLEAN), mode:workspaces(STRING), jcr:copiedFrom(STRING), jcr:retentionPolicy(STRING), jcr:root(STRING), jcr:versionableUuid(STRING), mode:generated(BOOLEAN), mode:localName(STRING), mode:id(STRING), mode:depth(LONG), jcr:score(DOUBLE), jcr:path(STRING), jcr:name(STRING)]>

       

      Am I missing something to get indexes working?

       

      Thanks,

      Jacob