[SR-Users] MySQL query result pagination

Allen Zhang Allen.Zhang at imgtec.com
Thu Jun 5 02:18:43 CEST 2014


Hi,

When an user does a REGISTER and has a large number of msilo messages stored, say 7k, kamailio server easily runs out of private memory when trying to allocate memory to the result set. I know I can set a max on the messages a user can store, but I'd like to support a crazy number like 7k messages.
I'm trying to introduce paging to the query. So that I can process N number of results at one time.
I can't find an easy way of doing this with the current MySQL driver. The db_mysql_query() function doesn't have built-in paging and with this function it's not easy to build a complex query like this:

Select * from silo where ...(the matching algorithm) AND id > lower_limit AND id < higher_limit, ordered by id.

Is there a way to do this? Or maybe I'm on the wrong track and there is already a solution to this problem?

Regards,

Allen Zhang

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140605/88fd4ee5/attachment.html>


More information about the sr-users mailing list