Hi Srinivas,

I was wondering why you doesn't use the xml:id attribute like this
/User1.xml



<User xml:id="1">



  <Group_id>10</Group_id>

  <Name>Mark</Name>

  <Project>

    <Name>Project1</Name>

  </Project>
</User>

/Group10.xml

<Group xml:id="10">
<Name>Admin</Name>
</Group>

With this structure you could use an element attribute query (to get good 
performance you would need to make sure the xml:id attribute is indexed)
cts:search(//module,
    cts:element-attribute-value-query(
      xs:QName("Group"),

      xs:QName("xml:id"),
      $group-id-referenced))

About performance in general if you make use of indexes in you searches you 
geet good performance.

Regards
Erik
Från: Srinivas [mailto:srini...@nervecentrex.com]
Skickat: den 16 februari 2015 06:54
Till: 'MarkLogic Developer Discussion'
Ämne: [MarkLogic Dev General] Query performance in MarkLogic

Hi All,

I was trying to build a database in MarkLogic with following document format.

/User1.xml



<User>

  <Id>1</Id>

  <Group_id>10</Group_id>

  <Name>Mark</Name>

  <Project>

    <Name>Project1</Name>

  </Project>
</User>

/Group10.xml

<Group>
<Id>10</Id>
<Name>Admin</Name>
</Group>

If I want to get the group name for the user id 1, how could I achieve it ? 
Shall I use qbe query to find the name or any other mechanism is there to 
connect both documents?

And if I use multiple queries, am I losing the performance here?


Thanks & Regards,
Srinivas | Sr CakePHP Programmer
+91 - 9538025790 | srini...@nervecentrex.com<mailto:srini...@nervecentrex.com>

nerve centrex software (India) pvt. Ltd.
122 soudhamini 3rd main gruhalakshmi layout II stage
Kamalanagar Bangalore 560079 Karnataka India

[cid:image002.png@01CF74D9.64936420]


Disclaimer: This communication is for informational purposes only. It is not 
intended as an offer or solicitation for the purchase or sale of any financial 
instrument or as an official confirmation of any transaction. All market 
prices, data and other information are not warranted as to completeness or 
accuracy and are subject to change without notice.  Any comments or statements 
made herein do not necessarily reflect those of Nerve Centrex Software (India) 
Pvt. Ltd., its subsidiaries and affiliates.

This message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify Nerve Centrex 
immediately by e-mail if you have received this e-mail by mistake and delete 
this e-mail from your system. E-mail transmission cannot be guaranteed to be 
secure or error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. Nerve Centrex 
Software (India) Pvt. Ltd., its subsidiaries and affiliates therefore does not 
accept liability for any errors or omissions in the contents of this message, 
which arise as a result of e-mail transmission. Although this transmission and 
any attachments are believed to be free of any virus or other defect that might 
affect any computer system into which it is received and opened, it is the 
responsibility of the recipient to ensure that it is virus free and no 
responsibility is accepted by Nerve Centrex Software (India) Pvt. Ltd., its 
subsidiaries and affiliates, as applicable, for any loss or damage arising in 
any way from its use.

_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to