Re: ORM_MPTT_Core function parents() -> mysql not using index

Bharat Mediratta <[email protected]> Sun, 18 Aug 2013 15:56:09 -0700
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CAESa+_nsSGnnXVniW+U_7o-Sc7haKZ_hxZ264faj66JqNn-Emw@mail.gmail.com>
--===============4944606736885827607==
Content-Type: multipart/alternative; boundary=089e01227b7c25a38204e440bd7d

--089e01227b7c25a38204e440bd7d
Content-Type: text/plain; charset=ISO-8859-1

cc: gallery-devel

I'm up to my ears right now - I'll get to this when I can (but it might be
a while).  You might considering asking in the forums...


On Thu, Aug 15, 2013 at 8:12 AM, Adrian <adrhc-/[email protected]> wrote:

> Hi, I'm sorry to bother you with this but I think you are the only one
> capable to help me.
>
> I find this in class ORM_MPTT_Core:
>   function parents() {
>     return $this
>       ->where("left_ptr", "<=", $this->left_ptr)
>       ->where("right_ptr", ">=", $this->right_ptr)
>       ->where("id", "<>", $this->id)
>       ->order_by("left_ptr", "ASC")
>       ->find_all();
>   }
>
> I'm using gallery 3 and it seems that mysql 5.1.30 is not using any index
> when executing the query generated by function parents(). I'd like to FORCE
> INDEX with mysql how would I do this ?
>
> thank you in advance
>
>
> *Adrian **Petre* (PMP certified)
> mail:    adrhc-/[email protected]
> phone: +04 0724 234 095
>

--089e01227b7c25a38204e440bd7d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">cc: gallery-devel<div><br><div>I&#39;m up to my ears right=
 now - I&#39;ll get to this when I can (but it might be a while). =A0You mi=
ght considering asking in the forums...</div></div></div><div class=3D"gmai=
l_extra">

<br><br><div class=3D"gmail_quote">On Thu, Aug 15, 2013 at 8:12 AM, Adrian =
<span dir=3D"ltr">&lt;<a href=3D"mailto:adrhc-/[email protected]" target=3D"_blank">=
adrhc-/[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div style=3D"font-size:12pt;font-family:tahoma,new york,times,serif">=
<div><span>Hi, I&#39;m sorry to bother you with this but I think you are th=
e only one capable to help me. <br></span></div><div style=3D"font-style:no=
rmal;font-size:16px;background-color:transparent;font-family:tahoma,new yor=
k,times,serif">

<br><span></span></div><div style=3D"font-style:normal;font-size:16px;backg=
round-color:transparent;font-family:tahoma,new york,times,serif">I find thi=
s in class ORM_MPTT_Core:</div><div style=3D"font-style:normal;font-size:16=
px;background-color:transparent;font-family:tahoma,new york,times,serif">

=A0 function parents() {<br>=A0=A0=A0 return $this<br>=A0=A0=A0=A0=A0 -&gt;=
where(&quot;left_ptr&quot;, &quot;&lt;=3D&quot;, $this-&gt;left_ptr)<br>=A0=
=A0=A0=A0=A0 -&gt;where(&quot;right_ptr&quot;, &quot;&gt;=3D&quot;,
 $this-&gt;right_ptr)<br>=A0=A0=A0=A0=A0 -&gt;where(&quot;id&quot;, &quot;&=
lt;&gt;&quot;, $this-&gt;id)<br>=A0=A0=A0=A0=A0 -&gt;order_by(&quot;left_pt=
r&quot;, &quot;ASC&quot;)<br>=A0=A0=A0=A0=A0 -&gt;find_all();<br>=A0 }<br><=
span></span></div><div style=3D"font-style:normal;font-size:16px;background=
-color:transparent;font-family:tahoma,new york,times,serif">

<br><span></span></div><div style=3D"font-style:normal;font-size:16px;backg=
round-color:transparent;font-family:tahoma,new york,times,serif">I&#39;m us=
ing gallery 3 and it seems that mysql 5.1.30 is not using any index when ex=
ecuting the query generated by function parents(). I&#39;d like to FORCE IN=
DEX with mysql how would I do this ?</div>

<div style=3D"font-style:normal;font-size:16px;background-color:transparent=
;font-family:tahoma,new york,times,serif"><br></div><div style=3D"font-styl=
e:normal;font-size:16px;background-color:transparent;font-family:tahoma,new=
 york,times,serif">

thank you in advance<br><span></span></div><div style=3D"font-style:normal;=
font-size:16px;background-color:transparent;font-family:tahoma,new york,tim=
es,serif"><span><br></span></div><div>=A0</div><div><font size=3D"3"><b>Adr=
ian <span style=3D"FONT-STYLE:italic"></span></b></font><font><font size=3D=
"3"><b>Petre</b></font> </font><font><font style=3D"color:rgb(208,208,208)"=
 size=3D"1"><span style=3D"FONT-STYLE:italic">(PMP certified)</span></font>=
<br>

</font><font size=3D"1">mail: =A0=A0 <a href=3D"mailto:adrhc-/[email protected]" tar=
get=3D"_blank">adrhc-/[email protected]</a><br>phone: +04 0724 234 095<br></font></d=
iv></div></div></blockquote></div><br></div>

--089e01227b7c25a38204e440bd7d--


--===============4944606736885827607==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
--===============4944606736885827607==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]
--===============4944606736885827607==--