Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted July 9, 20222 yr Front end shows approx. 2 million posts, but the forums_posts table contains only 1564317 rows. Do we have a problem?
July 9, 20222 yr 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.
July 9, 20222 yr 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.
July 9, 20222 yr Author All tables are Innodb. phpMyAdmin shows same values. ibf_core_search_index is 2076325 rows.
July 9, 20222 yr 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. 🙂
July 9, 20222 yr @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, 20222 yr by Nathan Explosion
July 10, 20222 yr Author 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?
July 10, 20222 yr Solution 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