Canis Posted July 9, 2022 Posted July 9, 2022 Front end shows approx. 2 million posts, but the forums_posts table contains only 1564317 rows. Do we have a problem?
Jim M Posted July 9, 2022 Posted July 9, 2022 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.
Stuart Silvester Posted July 9, 2022 Posted July 9, 2022 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. Jim M 1
Canis Posted July 9, 2022 Author Posted July 9, 2022 All tables are Innodb. phpMyAdmin shows same values. ibf_core_search_index is 2076325 rows.
Randy Calvert Posted July 9, 2022 Posted July 9, 2022 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. 🙂
Nathan Explosion Posted July 9, 2022 Posted July 9, 2022 (edited) @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)? Edited July 9, 2022 by Nathan Explosion
Canis Posted July 10, 2022 Author Posted July 10, 2022 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?
Solution Stuart Silvester Posted July 10, 2022 Solution Posted July 10, 2022 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
Canis Posted July 10, 2022 Author Posted July 10, 2022 Sure, that query gave 1998348 rows. Topic closed. 👍 SeNioR- 1
Recommended Posts