XF 1.5 why "position" field is used to page records?

sajal

Active member
On thread listing page, I can see the mysql query use something like this for paging purpose on Page-2.

(post.position >= 25 AND post.position < 50)

I'm bit of wondering why is that so? The issue is that I've deleted some posts having position column value 25 to 50. Now it 'll display blank thread page, since there are records in xf_post with that position.

Any ideas?
 
This is done for efficiency reasons.

If you deleted it through the UI, the positions are rebuilt as necessary. If you deleted through the DB directly, don't do that. :) You will need to rebuild the thread cache including post positions to fix it.
 
Thanks @Mike, that makes sense.

That brings you another set of questions :-)! Considering 250 records per page rebuild count, how much time it would take to complete 11M records? Do I need to put site in maintenance mode while running any of the rebuild operation? Can I increase that rebuild limit to 5000 records per page?
 
Last edited:
Run time and rebuild limits are really particular to your server setup. A larger rebuild limit may create more problems when large threads are processed.

You don't need to put it in maintenance mode unless there are performance problems from the rebuild (there are a lot of writes).
 
Top Bottom