Joomla 2.5 How many possible categories

让人想犯罪 __ 提交于 2019-12-25 02:57:21

问题


I googled but could only find answers for the max amount of articles.

Question: short Version:

How many possible categories (with subcategories) can Joomla 2.5 handle on a shared host. Which problems do I have to expect?

Question: long Version:

I m building an website for architects. The content structure looks like this

HOUSES
    Architect A
      Project 1
      Project 2
      ...

    Architect B
      Project 1
      Project 2
      ...

Places
    Architect C
      Project 1
      Project 2
      ...

    Architect D
      Project 1
      Project 2
      ...

And so on. The most obvious would be to have HOUSES and PLACES as Categories. Architect A, Architect B ... as subcategories and the Projects as articles. This would on the one hand keep the ability to use Joomlas Blog View etc. and not use third party CCK extensions but on the other hand this would probably cause 300 and more categories.

Thanks for your always great input,

Tony


回答1:


You're looking at 2147483647 possible categories in terms of the #__categories table.

In Joomla! 2.5's definition for the Categories table you will find:

CREATE TABLE `#__categories` (
  `id` int(11) NOT NULL auto_increment,
  `asset_id`

  <snip ... >

  `language` char(7) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `cat_idx` (`extension`,`published`,`access`),
  KEY `idx_access` (`access`),
  KEY `idx_checkout` (`checked_out`),
  KEY `idx_path` (`path`),
  KEY `idx_left_right` (`lft`,`rgt`),
  KEY `idx_alias` (`alias`),
  INDEX `idx_language` (`language`)
)  DEFAULT CHARSET=utf8;

As you can see the primary key is defined as an int so the max value on MySQL of an signed INT (2147483647) and default starting point of 1 results in just over 2.1 billion categories. See this *Note about AUTO_INCREMENT on MySQL

Note

There can be only one AUTO_INCREMENT column per table, it must be indexed, and it cannot have a DEFAULT value. An AUTO_INCREMENT column works properly only if it contains only positive values. Inserting a negative number is regarded as inserting a very large positive number. This is done to avoid precision problems when numbers “wrap” over from positive to negative and also to ensure that you do not accidentally get an AUTO_INCREMENT column that contains 0.

On a shared host you will run out of database space long before you reach this limit of the #__categories primary key — the rest of the record in the categories table specifies about 1300 times more space than the primary key uses. (roughly)

So, you're more likely to have normal content affect the hosting limits than just the categories table.




回答2:


The only limits are theoretical and largely depend on your hosting environment. Just know that the more you add, the more memory will be required to load category data where it is used, and can complicate the user interface depending on how much is visible at once.




回答3:


See some measurements done in a test site of mine (J2.5.x , did not test with J3.x but it should be the same):

A common PHP memory limit per script execution is 40MBs (server default)

You can expect to hit it with about 800 categories and thus get a memory exhausted fatal error (permission checking will take up 26MBs leaving the rest memory for other stuff ...)

that is in places where category tree is created and permissions are checked e.g. Joomla article Form

Note: if you are super admin then category permission checking will not take up ANY memory

Note: with a memory limit of 128MBs you can get to have up to (about) 3500 categories

Also with 5000+ or 10000+ categories you start having some small or medium performance problems, but that is really too many categories



来源:https://stackoverflow.com/questions/15604056/joomla-2-5-how-many-possible-categories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!