<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:D="DAV:" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:st="&#1;" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Z="urn:schemas-microsoft-com:"><head><META content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="text/html; charset=utf-8" http-equiv=Content-Type><meta content="Microsoft Word 12 (filtered medium)" name=Generator><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><BODY>
<DIV><div class=WordSection1><p class=MsoNormal>Hello, <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I&#8217;m interested in using the htable and/or mtree modules to keep my aliases and did lookups in memory to minimize the amount of SQL lookups that are being performed. It&#8217;s easy enough to use htable to cache a single value after it is retrieved but what I&#8217;m not clear on is how I can do it when SQL returns multiple destinations. Consider the following query and returned results:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>SELECT username,domain,CAST(q_value AS CHAR) FROM aliases where alias_username = '10001' AND alias_domain = 'us.sip.globeop.com' AND active = '1' ORDER by q_value;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>+----------+--------------------+-----------------------+<o:p></o:p></p><p class=MsoNormal>| username | domain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | CAST(q_value AS CHAR) |<o:p></o:p></p><p class=MsoNormal>+----------+--------------------+-----------------------+<o:p></o:p></p><p class=MsoNormal>| 8500&nbsp;&nbsp;&nbsp;&nbsp; | us.sip.globeop.com | 1.000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<o:p></o:p></p><p class=MsoNormal>| 3874&nbsp;&nbsp;&nbsp;&nbsp; | us.sip.globeop.com | 1.000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<o:p></o:p></p><p class=MsoNormal>| 7050&nbsp;&nbsp;&nbsp;&nbsp; | us.sip.globeop.com | 1.000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<o:p></o:p></p><p class=MsoNormal>| 2100&nbsp;&nbsp;&nbsp;&nbsp; | us.sip.globeop.com | 1.000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<o:p></o:p></p><table border=1 cellpadding=0 cellspacing=0 class=MsoNormalTable style='margin-left:8.4pt;border-collapse:collapse;border:none'><tr><td style='width:43.5pt;border:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt' valign=top width=58><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></td><td style='width:81.0pt;border:solid windowtext 1.0pt;border-left:none;padding:0in 5.4pt 0in 5.4pt' valign=top width=108><p class=MsoNormal><o:p>&nbsp;</o:p></p></td><td style='width:92.25pt;border:solid windowtext 1.0pt;border-left:none;padding:0in 5.4pt 0in 5.4pt' valign=top width=123><p class=MsoNormal><o:p>&nbsp;</o:p></p></td></tr></table><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>In my existing script I just append the results as branches and all works well but I end up with a lot of unnecessary SQL traffic. I see the htable supports array but I&#8217;m not sure how to go about assigning multiple values to a single key to use later. How can I take the above results and store them in memory for use by other transactions? <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Bob<o:p></o:p></p></div></DIV>
<DIV>
<HR>
</DIV>
<DIV STYLE="FONT-SIZE: 9pt; FONT-FAMILY: Courier New">This email with all information contained herein or attached hereto may contain confidential and/or privileged information intended for the addressee(s) only. If you have received this email in error, please contact the sender and immediately delete this email in its entirety and any attachments thereto.</DIV></BODY></HTML>