Hello,
I’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’s easy enough to use htable to cache a single value after it is retrieved but what I’m not clear on is how I can do it when SQL returns multiple destinations. Consider the following query and returned results:
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;
+----------+--------------------+-----------------------+
| username | domain | CAST(q_value AS CHAR) |
+----------+--------------------+-----------------------+
| 8500 | us.sip.globeop.com | 1.000 |
| 3874 | us.sip.globeop.com | 1.000 |
| 7050 | us.sip.globeop.com | 1.000 |
| 2100 | us.sip.globeop.com | 1.000 |
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’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?
Thanks,
Bob