<div dir="ltr">On Fri, Jun 7, 2013 at 3:31 PM, Vegard Vesterheim <span dir="ltr"><<a href="mailto:vegard.vesterheim@uninett.no" target="_blank">vegard.vesterheim@uninett.no</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, 07 Jun 2013 09:32:46 +0200 Christian Loos <<a href="mailto:cloos@netcologne.de">cloos@netcologne.de</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> the Database indexes are not optimal for the ObjectCustomFieldValues<br>
> table. Sadly I didn't had time to dig deeper into this.<br>
> But maybe you have time and an new index will help you.<br>
<br>
</div>Thanks for the tip. Better indexing might help, but in this case the SQL<br>
query is clearly suboptimal, so a fix in the SQL generation is in order<br>
anyway. In our database, a properly optimised SQL statement returns<br>
results immediately.<br></blockquote><div><br></div><div style>In this case there is no better indexing. The SQL itself falls into category of hardly optimizable by DBs. Some DBs do better job by using hash joins, but mysql with its loop strategy can not cope.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> There is already an ticket open for this:<br>
> <a href="http://issues.bestpractical.com/Ticket/Display.html?id=16898" target="_blank">http://issues.bestpractical.com/Ticket/Display.html?id=16898</a><br>
<br>
</div>The symptoms might be the same (slow queries), so the tickets might be<br>
related, but I think this is two separate issues which will require<br>
different solutions. One issue is about suboptimal SQL, the other issue<br>
is about suboptimal indexes.<br>
<br>
- Vegard V -<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
RT Training in Seattle, June 19-20: <a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards, Ruslan.
</div></div>