Mary,
Thanks for your answer.
I'll check on representing one-to-many relationships in a different way for now.

Best,
Ankur Patwa


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Mary Holstege
Sent: Tuesday, November 27, 2012 10:31 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Need help with SQL


On Mon, 26 Nov 2012 18:01:18 -0800, Ankur Patwa 
<[email protected]> wrote:

> All,
> I found the answer in SQL Modelling guide in Fragment Roots in 
> Database section.
> One caveat with it is that it breaks other cts queries and free text 
> searches.
> Our fragments are defined at document level right now and would like 
> to keep it that way.
> I’ve tried creating a Fragment Root at document’s root element but it 
> looks like the fragments do not jive well with one another.
> Should I be creating a Fragment Parent at the root level but to no avail.
> What should I try next?
> Any help/insight is much appreciated.
>
> Thanks in advance.
>
> Best,
> Ankur
>


When we are computing rows, we compute the cross product of all values in the 
fragment for each of the columns. Since your fragment contains multiple 
instances of the given columns, you will get multiple rows. What is more, all 
of this selection is unfiltered (as is execution of MATCH clauses), so you need 
to ensure that you have sufficient indexes to give the results you want under 
these circumstances.

Self joining isn't going to help at all, because all those rows from the same 
document will have the same URI anyway.

Right now there is no way to require that the columns for a row all fall under 
the *same* element instance. Nothing in your view specification is saying that 
that should be the case. We do understand that people want richer data modeling 
options for SQL, and are looking at ways we can improve.

The right way to think about modeling for SQL access is that a document
(fragment) is a row.

//Mary

[email protected]
Principal Engineer
MarkLogic Corporation



_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general



NOTICE OF CONFIDENTIALITY: This electronic message, including attachments, is 
for the sole use of the named recipient and may contain confidential or 
privileged information protected by State of Tennessee and Federal regulations. 
 Any unauthorized review, use, disclosure, copying or distribution is strictly 
prohibited.  If you are not the intended recipient or have received this 
communication in error please contact the sender or email 
[email protected] and destroy all copies of the original message. Thank 
you.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to