Jump to content

athlonkmf

Friends
  • Posts

    92
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Everything posted by athlonkmf

  1. Howabout putting an if-statement then ;) Use count if there's less than1000 posts (from cache) otherwise, just use the cachethingie. Anyway, for the record. I just had time to take a better look. For (reference and) those who are cursed with a large board, they might want to do this. /* Get all posts */ // $cacheContent['posts'] = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', // 'from' => 'posts' ) ); /* Get all members */ // $cacheContent['members'] = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', // // $this->caches =& $this->registry->cache()->fetchCaches(); $cacheContent['posts'] = array('count'=>intval($this->caches['stats']['total_replies'])); $cacheContent['members'] = array('count'=>intval($this->caches['stats']['mem_count']));
  2. Well, here's one example for you where rowlevel locking is needed. In fact, when our forum had 1000 visitors at once, rowlevel locking was already needed, because the posting went that fast that there were too many table locks. Which often caused an avalanche effect, making the site effectively inaccessable. InnoDB solved that. And we're happy too, now that we have 4000+ visitors at a given time, but that innodb vs myisam is another discussion The thing is, the total amount of posts and total amount of members are already cached and in that page, it's only meant for a statistics. xx cached posts vs xx total amount of posts. Unless the percentage had 100 decimals, or the board only has 100 posts, it won't matter much what the percentage is. Why not just use the cached value? It's only a tip for a better user experience, as I'll be editing it for myself anyway. Oh, and you're better off doing a select count(primary_id) than a select count(*) if it's really needed. Effect might me marginal, but every little thing helps
  3. I just had the chance to test out ipb302, preparing for an upgrade. And i noticed that there are a lot of select count(*) in the admin panel. Like the cache_overview. It counts all posts and members just for a percentage showing. With an innodb database, 5 million posts and 200k members, that's not funny at all.. Can't it just use the board statistics which is cached anyway? something like this: in admin\applications\core\modules_admin\tools\cache.asp use $cacheContent['posts'] = intval($this->caches['stats']['total_replies']); instead of $cacheContent['posts'] = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', 'from' => 'posts' ) );
×
×
  • Create New...