The config value "search_block_size" is set to 250 by default? What is the reason for this? My hosting company was complaining about a queries that were running slow and kept showing me examples of queries with the "LIMIT 250", suggesting to lower it (maybe they thought I was showing 250 posts per page or something).
So I have two questions, does the LIMIT clause, having a large value, slow down the query, or possibly just use more memory? Does this config value need to be this large, what is the point?
Search block size
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
- Highway of Life
- Registered User
- Posts: 1399
- Joined: Tue Feb 08, 2005 10:18 pm
- Location: I'd love to change the World, but they won't give me the Source Code
- Contact:
Re: Search block size
The search_block_size has to do with the number of posts (or topics) that are cached per search result. If you have 25 posts per page, this would be 10 pages worth of cached results. This means that if you do a search, it’s not going to re-query the search on the second page, third page, etc... it just queries once.
Naturally, a query with a LIMIT of 250 is going to be a bit heavier on the database server then the same query with a LIMIT of 100. (for example).
If you believe that users only view the first 2 or 3 pages, you can decrease this figure to 50 or 75, which would be less results, however, do note that this change may result in additional queries to the search tables if people search page the first couple of pages, ultimately resulting in a heavier load.
Another question you should address is what kind of search backend are you using compared to the size of board that you have.
For example, I have what you might consider a medium sized board, I used the Fulltext MySQL search backend, I find that this is a bit faster for a board our size.
Joomla.org and phpBB.com use the third-party Sphinx Search Plugin, this is best for very large boards such as these. Many small boards may be much faster with the native search backend.
It depends on the size of your board, your server setup and settings, and your database type.
That said, I find it very odd that a host would complain about this type of thing, I would be curious to see the stats on just "how" slow they say slow is, and then reproduce the problem your self, how slow is slow, exactly?
Naturally, a query with a LIMIT of 250 is going to be a bit heavier on the database server then the same query with a LIMIT of 100. (for example).
If you believe that users only view the first 2 or 3 pages, you can decrease this figure to 50 or 75, which would be less results, however, do note that this change may result in additional queries to the search tables if people search page the first couple of pages, ultimately resulting in a heavier load.
Another question you should address is what kind of search backend are you using compared to the size of board that you have.
For example, I have what you might consider a medium sized board, I used the Fulltext MySQL search backend, I find that this is a bit faster for a board our size.
Joomla.org and phpBB.com use the third-party Sphinx Search Plugin, this is best for very large boards such as these. Many small boards may be much faster with the native search backend.
It depends on the size of your board, your server setup and settings, and your database type.
That said, I find it very odd that a host would complain about this type of thing, I would be curious to see the stats on just "how" slow they say slow is, and then reproduce the problem your self, how slow is slow, exactly?