<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Tilghman Lesher schrieb:<br>
</tt>
<blockquote
 cite="mid:200908171753.47401.tilghman@mail.jeffandtilghman.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap=""><tt>1- Same query is performed more than once:

For example: the query below regarding the priority "3" from extension
"102" of context "sip" gets performed 3 times... and the same happens
with prior steps(priorities).

SELECT * FROM extensions WHERE exten = '102' AND context = 'sip' AND
priority = '3'
</tt></pre>
  </blockquote>
  <pre wrap=""><tt>Yes, that's correct.  It's not optimal, but due to the dialplan architecture,
it's somewhat unavoidable.  A possible optimization would be to cache the
results of queries for some short period of time.
</tt></pre>
</blockquote>
<tt>I still can't grasp why a query like this must be performed three
(or more) times. <br>
It will always return the same set of results, if the row was not
changed in the meanwhile.<br>
<br>
Executing this query more than once for a single lookup is pointless
and clearly a waste of resources.<br>
<br>
The "a" extension could be looked up at the point when a caller
actually pressed '*', there's no need to look it up if the caller does
not press '*'.<br>
This behaviour can only be altered in app_voicemail and not in
res_mysql, i think.<br>
<br>
<br>
Best Regards,<br>
<br>
Kai Hoerner<br>
<br>
<br>
<span class="moz-txt-tag">--&nbsp;<br>
</span>CIPHRON GmbH
<br>
<br>
Tel.: (05 11) 51 51 33 - 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (05 11) 51 51 33 - 29
<br>
Web: <a class="moz-txt-link-freetext" href="http://www.ciphron.de/">http://www.ciphron.de/</a>&nbsp;&nbsp;&nbsp;&nbsp;
Support:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (05 11) 51 51 33 - 11
<br>
<br>
Ust.Id.: DE263362886&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Gesch&auml;ftsf&uuml;hrer:&nbsp; Sebastian Horzela
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Amtsgericht Hannover, HRB 203590
<br>
</tt>
</body>
</html>