cancel
Showing results for 
Search instead for 
Did you mean: 

Querying is not scalable? (cross-posted from JCR forum)

panokhin
Champ in-the-making
Champ in-the-making
This is cross-posted from JCR forum as I feel I may have problems with the test setup. If you see any, I'd very much wanted to hear your comments.
——————-
Hello.

I'm currently evaluating Alfresco for use as a platform for our electronic tendering service. We really like the architecture and code quality, however there are some concerns about its scalability.

I'm trying to do a simple test of loading about 1700 objects (I'll include the complete model and sample code below) and querying them using JCR API (we decided to go with JCR since it seems to becoming a widely adopted standard).

The model is like this: Site->Buyer->Buyer->Notice->LangProperty
There are about 1300 of LangProperties, 300 of Notices and 100 of Buyers.
The computer is AMD Athlon 64 3200+ with 2Gb memory, running both Oracle XE and JBoss+Alfresco.
I ran this XPath query:
Query q = qm.createQuery("//dg:notices/dg:langProperties[jcr:contains(@dgSmiley TongueropText,'solicitation')]/..",Query.XPATH);
and results were quite disappointing - between 60 and 80 seconds on different runs.

So, I wanted to ask 3 questions:
1. Is this poor result due to the fact that JCR support is new in Alfresco, so it's going to be changed in near future to be more scalable?
2. If we use Alfresco search API instead, will it scale better or the problem is in the model we use: few nodes but many (large text) properties?
3. Are there any support (current or planned) in Alfresco's version of JCR search or it's own Lucene search for language-specific search modifiers (e.g. stemming, base letter conversion, fuzzy search)?

Thank you,
Looking forward to hearing your advice,
Philipp.
3 REPLIES 3

panokhin
Champ in-the-making
Champ in-the-making
The model:

<model name="dg:dgmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

    <description>dgMarket model</description>
    <author>Philipp Anokhin</author>
    <version>1.0</version>

    <imports>
       <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
       <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
    </imports>

    <namespaces>
       <namespace uri="http://www.dgmarket.com/model/dgModel/1.0" prefix="dg" />
    </namespaces>

    <types>

       <type name="dg:category">
          <title>dg Categotry</title>
          <parent>cm:content</parent>
          <properties>
             <property name="dg:category">
                <type>d:text</type>
             </property>
             <property name="dg:type">
                <type>d:text</type>
                <default>cpv</default>
             </property>
          </properties>
       </type>

       <type name="dg:country">
          <title>dg Country</title>
          <parent>cm:content</parent>
          <properties>
             <property name="dg:iso">
                <type>d:text</type>
             </property>
          </properties>
       </type>

       <type name="dg:contact">
          <title>dg Contact</title>
          <parent>cm:content</parent>
          <properties>
             <property name="dg:contactId">
                <type>d:text</type>
             </property>
             <property name="dg:contactFirstNames">
                <type>d:text</type>
             </property>
             <property name="dg:contactLastName">
                <type>d:text</type>
             </property>
             <property name="dg:contactTitle">
                <type>d:text</type>
             </property>
             <property name="dg:contactOrganization">
                <type>d:text</type>
             </property>
             <property name="dg:contactAddress">
                <type>d:text</type>
             </property>
             <property name="dg:contactAddress2">
                <type>d:text</type>
             </property>
             <property name="dg:contactCity">
                <type>d:text</type>
             </property>
             <property name="dg:contactProvince">
                <type>d:text</type>
             </property>
             <property name="dg:contactPostalCode">
                <type>d:text</type>
             </property>
             <property name="dg:contactPhone">
                <type>d:text</type>
             </property>
             <property name="dg:contactFax">
                <type>d:text</type>
             </property>
             <property name="dg:contactEmail">
                <type>d:text</type>
             </property>
             <property name="dg:contactUrl">
                <type>d:text</type>
             </property>
             <property name="dg:contactCountry">
                <type>d:noderef</type>
             </property>
          </properties>
          <mandatory-aspects>
             <aspect>cm:versionable</aspect>
          </mandatory-aspects>
       </type>

       <type name="dg:langProperty">
          <title>dg Language Property</title>
          <parent>cm:content</parent>
          <properties>
             <property name="dg:propName">
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
             <property name="dg:propText">
                <type>d:text</type>  <– This can be very large
                <mandatory>false</mandatory>
                <index enabled="true">
                   <atomic>true</atomic>
                   <stored>false</stored>
                   <tokenised>true</tokenised>
                </index>
             </property>
             <property name="dg:propLang">
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
          </properties>
       </type>

       <type name="dg:notice">
          <title>dg Notice</title>
          <parent>cm:folder</parent>
          <properties>
             <property name="dg:noticeId">
                <type>d:text</type>
             </property>
             <property name="dg:noticeType">
                <type>d:text</type>
             </property>
             <property name="dg:noticeLang">
                <type>d:text</type>
             </property>
             <property name="dg:noticeSubmitted">
                <type>d:date</type>
             </property>
             <property name="dg:noticeDeadline">
                <type>d:datetime</type>
             </property>
             <property name="dg:noticeExpiration">
                <type>d:date</type>
             </property>
             <property name="dg:noticeMethod">
                <type>d:text</type>
             </property>
             <property name="dg:noticeCity">
                <type>d:text</type>
             </property>
             <property name="dg:noticePostalCode">
                <type>d:text</type>
             </property>
             <property name="dg:noticePublisher">
                <type>d:text</type>
             </property>
             <property name="dg:noticeCountry">
                <type>d:noderef</type>
             </property>
             <property name="dg:noticeCategory">
                <type>d:noderef</type>
                <multiple>true</multiple>
             </property>
          </properties>
          <associations>
             <child-association name="dg:noticeContact">
                <source>
                   <mandatory>false</mandatory>
                   <many>false</many>
                </source>
                <target>
                   <class>dg:contact</class>
                   <mandatory>false</mandatory>
                   <many>false</many>
                </target>
                <duplicate>false</duplicate>
             </child-association>
          </associations>
          <mandatory-aspects>
             <aspect>cm:versionable</aspect>
          </mandatory-aspects>
       </type>

       <type name="dg:buyer">
          <title>dg Buyer</title>
          <parent>cm:folder</parent>
          <properties>
             <property name="dg:buyerId">
                <type>d:text</type>
             </property>
             <property name="dg:buyerType">
                <type>d:text</type>
             </property>
             <property name="dg:buyerLang">
                <type>d:text</type>
             </property>
             <property name="dg:buyerCountry">
                <type>d:noderef</type>
             </property>
          </properties>
          <associations>
             <child-association name="dg:buyerContact">
                <source>
                   <mandatory>false</mandatory>
                   <many>false</many>
                </source>
                <target>
                   <class>dg:contact</class>
                   <mandatory>false</mandatory>
                   <many>false</many>
                </target>
                <duplicate>false</duplicate>
             </child-association>
          </associations>
       </type>
      
       <type name="dg:site">
          <title>dg Site</title>
          <parent>cm:folder</parent>
          <properties>
             <property name="dg:siteName">
                <type>d:text</type>
             </property>
          </properties>
       </type>
      
     </types>

</model>

panokhin
Champ in-the-making
Champ in-the-making
Generating code:

   public static Node addBuyer(Node node, Buyer buyer)
      throws Exception
   {
        Node b = node.addNode("dg:buyers","dg:buyer");
        b.setProperty("dg:buyerId",buyer.getId().toString());
        b.setProperty("cm:name","buyer:"+buyer.getId().toString());
        //print(b);
      if(buyer.getBuyerTexts()!=null)
      {
         Iterator it = buyer.getBuyerTexts().iterator();
         while(it.hasNext())
         {
            BuyerText bt = (BuyerText)it.next();
            Node lp = b.addNode("dg:langProperties","dg:langProperty");
              lp.setProperty("cm:name",bt.getTextType());
              lp.setProperty("dg:propName",bt.getTextType());
              lp.setProperty("dg:propLang",bt.getLang());
              lp.setProperty("dg:propText",bt.getText());
              lp.setProperty("cm:content",bt.getText());
              //print(lp);
         }
      }
      if(buyer.getBuyerNotices()!=null)
      {
         System.out.println("\t\t\t\tNumber of notices is: "+buyer.getBuyerNotices().size());
         System.out.flush();
         Iterator it = buyer.getBuyerNotices().iterator();
         while(it.hasNext())
         {
            Notice notice = (Notice)it.next();
              Node n = b.addNode("dg:notices","dg:notice");
              n.setProperty("dg:noticeId",notice.getId().toString());
              n.setProperty("cm:name","notice:"+notice.getId().toString());
              //print(n);
            if(notice.getNoticeTexts()!=null)
            {
               Iterator itt = notice.getNoticeTexts().iterator();
               while(itt.hasNext())
               {
                  NoticeText nt = (NoticeText)itt.next();
                  Node lp = n.addNode("dg:langProperties","dg:langProperty");
                    lp.setProperty("cm:name",nt.getTextType());
                    lp.setProperty("dg:propName",nt.getTextType());
                    lp.setProperty("dg:propLang",nt.getLang());
                    lp.setProperty("dg:propText",nt.getText());
                    lp.setProperty("cm:content",nt.getText());
                    //print(lp);
               }
            }
         }
      }
      return b;
   }

kevinr
Star Contributor
Star Contributor