[ejabberd] Implementing XEP-0059 (question for mnesia gurus)

Eric Cestari eric at ohmforce.com
Fri Oct 10 19:13:19 MSD 2008


> However, please correct me if I'm wrong, but it looks like it allows  
> to
> implement LIMIT part of paging only, not the OFFSET one - this means  
> the
> complexity is still linear, thus leading, I believe, to the speed
> comparable with mod_archive implementation for worst-case scenarios  
> (small
> requests near the end of table), which represent quite typical use  
> case for
> RSM. Memory usage, on the other hand, should be indeed improved in  
> this
> case, though.

Yes. Hopefully RSM favors a sequential approach :)

I am thinking of implementing a process that would execute the query  
and access it though the qlc cursor.
The results would be cached (with maybe a FIFO). The process would be  
attached to a specific user, so that his ulterior rsm queries on the  
same set would be directed to it.

Worst case is still worst case, though.

> One solution to that problem I also though about in the past (and that
> might work well with the QLC approach) is creation of special indices,
> which main function is to allow to implement OFFSET indirectly, by
> providing the appropriate query condition (Key >= Offset && Key <  
> Offset +
> Limit). However, this approach is quite difficult to implement &  
> maintain
> because at least for archiving you will need different indices for
> different types of queries (as there are different ways to formulate
> queries which influence the ordering of results included), and in the
> presence of many updates it might become too expensive (as these  
> indices
> will also require up to the linear update on each one-item update),  
> so in
> the end I discarded that idea and in fact would not recommend that to
> anyone ;-)

Thanks for your insight. That does indeed not seem quite reasonable :)

> -- 
> Good luck!                                     Alexander
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd

More information about the ejabberd mailing list