How can i get the offline messages from memory?

I use ejabberd as xmpp server,and use mysql to store the offline messages.when i get a little of messages from mysql ,it's ok(i.e one client accept 20,000).but when i get lots of the messages from database(i.e one client accept messages > 50,000) ,it delete messages from mysql to store the memory,but i can't receive the message from memory.
Why?
Who can answer this question?
Thanks!

Syndicate content