<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Hi,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">I have a question on implementation of the LIMIT SQL
clause.</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="EN-GB"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">Using the LIMIT clause, I want to reduce the computation time for a
query.</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="EN-GB"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">When I try to limit the result of a joined table, however, the join
willbe computed first (which takes very long).</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="EN-GB"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><span class="GramE"><font
face="Arial"size="2"><span lang="EN-GB"
style="font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-GB">Lets</span></font></span><fontface="Arial"
size="2"><spanlang="EN-GB" style="font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-GB"> suppose the following example:</span></font><p class="MsoNormal"><font face="Arial"
size="2"><spanlang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><span class="GramE"><font
face="Arial"size="2"><span lang="EN-GB"
style="font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-GB">select</span></font></span><fontface="Arial"
size="2"><spanlang="EN-GB" style="font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-GB"> * from T1 join T2 on T1.id = T2.id LIMIT 1</span></font><p class="MsoNormal"><font
face="Arial"size="2"><span lang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="EN-GB"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">Conceptually, it should be possible to fetch one row from T1 and T2,
i.e.to propagate the LIMIT clause.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-GB"
style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="EN-GB"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">I was wondering what the exact requirements are to propagate the
LIMITclause.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="EN-GB"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">Do I need a foreign key relation between T1 and T2?</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">Do I need to use a full outer join in order to propagate the LIMIT
clause?</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="EN-GB"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB">Thanks</span></font><p class="MsoNormal"><font face="Arial"
size="2"><spanlang="EN-GB" style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB"> </span></font><p class="MsoNormal"
style="mso-layout-grid-align:none"><fontface="Arial" size="2"><span lang="EN-GB"
style="font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-GB;mso-bidi-font-weight:bold;mso-no-proof:yes">Gregor
Zeitlinger</span></font><fontface="Arial" size="2"><span lang="EN-GB"
style="font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-GB;
mso-bidi-font-weight:bold;mso-no-proof:yes"></span></font><p class="MsoNormal" style="mso-layout-grid-align:none"><font
color="black"face="Arial" size="2"><span lang="EN-GB" style="font-size:10.0pt;font-family:Arial;
color:black;mso-ansi-language:EN-GB;mso-bidi-font-weight:bold;mso-no-proof:
yes">LUCAS Product Development</span></font><font color="#00204e" face="Arial" size="2"><span lang="EN-GB"
style="font-size:10.0pt;font-family:Arial;
color:#00204E;mso-ansi-language:EN-GB;mso-bidi-font-weight:bold;mso-no-proof:
yes"></span></font><p class="MsoNormal" style="mso-layout-grid-align:none"><font color="black" face="Arial"
size="2"><spanlang="EN-GB" style="font-size:10.0pt;font-family:Arial;
color:black;mso-ansi-language:EN-GB;mso-bidi-font-weight:bold;mso-no-proof:
yes"> </span></font><p class="MsoNormal" style="mso-layout-grid-align:none"><b><font color="#00204e" face="Arial"
size="2"><spanlang="EN-GB" style="font-size:10.0pt;font-family:
Arial;color:#00204E;mso-ansi-language:EN-GB;font-weight:bold;mso-no-proof:yes">Torex</span></font></b><b><font
color="black"face="Arial" size="2"><span lang="EN-GB" style="font-size:10.0pt;
font-family:Arial;color:black;mso-ansi-language:EN-GB;font-weight:bold;
mso-no-proof:yes"> </span></font></b><b><font color="#54bceb" face="Arial" size="2"><span lang="EN-GB"
style="font-size:10.0pt;font-family:Arial;
color:#54BCEB;mso-ansi-language:EN-GB;font-weight:bold;mso-no-proof:yes">Retail</span></font></b><b><font color="black"
face="Arial"size="2"><span lang="EN-GB" style="font-size:10.0pt;
font-family:Arial;color:black;mso-ansi-language:EN-GB;font-weight:bold;
mso-no-proof:yes"> Solutions GmbH</span></font></b><p class="MsoNormal" style="mso-layout-grid-align:none"><font
face="Arial"size="2"><span lang="EN-GB" style="font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-GB;
mso-no-proof:yes"> </span></font><p class="MsoNormal" style="mso-layout-grid-align:none"><font face="Arial"
size="2"><spanstyle="font-size:10.0pt;font-family:Arial;mso-no-proof:yes">Schwedenstr. 9, D-13359 Berlin <b><span
style="font-weight:bold"></span></b></span></font><pclass="MsoNormal" style="mso-layout-grid-align:none"><font
face="Arial"size="2"><span style="font-size:10.0pt;font-family:Arial;mso-no-proof:yes">Tel. +49 (0) 30
49901-243</span></font><spanstyle="mso-no-proof:yes"></span><p class="MsoAutoSig"><font face="Arial" size="2"><span
lang="FR"style="font-size:
10.0pt;font-family:Arial;mso-ansi-language:FR;mso-no-proof:yes">Fax +49 (0) 30 49901-139</span></font><span
style="mso-no-proof:yes"></span><pclass="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size:
12.0pt;mso-no-proof:yes"> </span></font><p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size:
12.0pt;mso-no-proof:yes"><a href="mailto:gregor.zeitlinger@torexretail.de"><font face="Arial" size="2"><span
style="font-size:10.0pt;font-family:Arial">Mailto:gregor.zeitlinger@torexretail.de</span></font></a></span></font><p
class="MsoNormal"><fontface="Times New Roman" size="3"><span style="font-size:
12.0pt;mso-no-proof:yes"><a href="http://www.torexretail.de/"><font face="Arial" size="2"><span
style="font-size:10.0pt;font-family:Arial">http://www.torexretail.de</span></font></a></span></font><p
class="MsoNormal"><fontface="Times New Roman" size="3"><span style="font-size:
12.0pt"> </span></font></div>