July 9, 2022 in Technical Problems
Front end shows approx. 2 million posts, but the forums_posts table contains only 1564317 rows.
Do we have a problem?
Could you please clarify where you're seeing that count? Keep in mind some database tools like PHPMyAdmin will cache table row counts at certain sizes. In your database, I am seeing roughly 2 million posts in your post table.
From ACP SQL toolbox:
If you're using InnoDB, that number will also only be an approximation. It doesn't accurately reflect the exact number of rows in the table. Additionally, if you have over a certain threshold of posts the widgets use different means to calculate a number. It's less accurate, but counting how many rows are in large tables is very slow.
All tables are Innodb. phpMyAdmin shows same values.
ibf_core_search_index is 2076325 rows.
Stuart noted what was happening above. The count there is approximate. As a result, it does not make sense to try and use it to get a truly accurate number.
In fact, in the latest version of IPB, the SQL toolbox is removed. So in a nutshell... forget about what you're looking at there. 🙂
@Canis - just a suggestion (one that would be logical instead of the possible cause mentioned above) but have you enabled archiving on your site, which would move content out of your main database and into a separate database?
Or maybe your site is of the older type, pre-4.something, and the old way of the value being cumulative but not not taking account of deleted content (it now does, delete content - bang, it's gone from the count)?
Many thanks for all help. 🙂
We have never used archiving. It is 4x.
1.5 vs 2 million seems like a pretty significant difference. How can we be sure that we really have 2m posts?
You could do something like this to see a more accurate number of posts
SELECT count(*) FROM ibf_forums_posts;
Displaying in widgets and database tools (PMA etc) are never going to show a 100% accurate number due to the way InnoDB works though (and the above count query being slow).
It really isn't anything to worry about though
Sure, that query gave 1998348 rows.
Topic closed. 👍
Started Sunday at 05:51 PM
Started 3 hours ago
Started 21 hours ago