<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>4657</bug_id>
          
          <creation_ts>2007-06-17 18:18:43 +0000</creation_ts>
          <short_desc>Restrict the use of deref in sml:field/@xpath for SML implementation built on top of relational databases</short_desc>
          <delta_ts>2007-11-29 19:27:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>SML</product>
          <component>Core</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>LC</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pratul Dublish">pratul.dublish</reporter>
          <assigned_to name="Kumar Pandit">kumarp</assigned_to>
          <cc>bassamt</cc>
          
          <qa_contact name="SML Working Group discussion list">public-sml</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>15450</commentid>
    <comment_count>0</comment_count>
    <who name="Pratul Dublish">pratul.dublish</who>
    <bug_when>2007-06-17 18:18:43 +0000</bug_when>
    <thetext>Implementation of SML identity constraints that use the smlfn:deref() function in sml:field/@xpath expressions is challenging for persistent SML stores built on top of relational database systems. The standards body to which SML gets submitted should investigate this and, if needed, explore options to ease the implementation burden for persistent SML stores using relational databases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16168</commentid>
    <comment_count>1</comment_count>
    <who name="Kumar Pandit">kumarp</who>
    <bug_when>2007-08-16 19:36:54 +0000</bug_when>
    <thetext>*** Bug 4827 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16297</commentid>
    <comment_count>2</comment_count>
    <who name="Valentina Popescu">popescu</who>
    <bug_when>2007-08-28 13:23:25 +0000</bug_when>
    <thetext>per f2f decision, moving defect to LC</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17006</commentid>
    <comment_count>3</comment_count>
    <who name="Kumar Pandit">kumarp</who>
    <bug_when>2007-10-03 06:04:07 +0000</bug_when>
    <thetext>Proposal:
Disallow the use of deref in sml:field/@xpath for SML implementation built on top of relational databases.

Reasons:
[1]
The deref() calls can be nested to any level in the selector or field. Consider the following selector xpath.

deref(deref(deref(a)/b)/c)/d/e

To evaluate this identity constraint graph, we need to perform a 3 level recursion using a recursive CTE as the first step. Assuming a 10 ref fan-out at each level, it gives us 1000 nodes at the leaf level. This can be done in a relatively straightforward way using a single CTE call. For each of the documents in the target document set thus obtained, we need to apply the xpath /d/e to get the target node set.

Suppose we have to further evaluate a field xpath such as the one shown below.

deref(f)/g

Here, for each node in the target node set, we need to make a CTE call. Remember that the deref() can be nested to any level. To make matters worse, we may have a case where there are 2 (or more) field xpaths. One without deref() and one with a single deref() (and one with 2 level deref() and so on...). This requires us to combine the result set of the first CTE with that of each of the further CTEs. This is an extremely inefficient operation to perform in a large store.

If we can simply shift the deref(f) into the selector xpath (for example, deref(deref(deref(deref(a)/b)/c)/d/e)/f)/g) then we can compute the same result set in just one CTE.

There is a huge difference in the performance in the 2 cases.

[2]
Allowing deref() only in the selector support almost all practical cases. 

[3]
If we decide to add this support later it will be a non-breaking change. On the other hand, if we allow deref() in field now and decide to remove that support in later versions of SML, it will be a breaking change. Breaking changes are nearly impossible to make once a standard is adopted.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17166</commentid>
    <comment_count>4</comment_count>
    <who name="Valentina Popescu">popescu</who>
    <bug_when>2007-10-12 21:31:06 +0000</bug_when>
    <thetext>Attached is the result of investigating this issue as required by action http://www.w3.org/2005/06/tracker/sml/actions/118

http://lists.w3.org/Archives/Public/public-sml/2007Oct/0048.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>