Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Give mv_max_matches (aka mm) some real teeth
* Make mv_max_matches stop all further searching once the limit is hit, rather than loading the entire result set into memory and then truncating it. In my tests with a 700,000+ row products table, this is dramatically faster when limiting results to 1000, but surprisingly it adds little overhead even when still fetching the entire table. * Add pragma max_matches, which takes precedence over user-supplied mv_max_matches unless the user-supplied argument is more restrictive. Please note that e.g. [pragma max_matches 1000] on a search landing page will be processed too late to affect the search, because searches are done in an ActionMap that runs before the page is seen. You can use a catalog Pragma directive like this: Pragma max_matches=1000 Which will affect everything in the catalog, including the admin. If you want to make exceptions to the mv_max_matches limit based on URL, you can instead use an Autoload that calls a GlobalSub, like this: interchange.cfg: GlobalSub <<EOR sub set_pragma_max_matches { $::Pragma->{max_matches} = 1000 unless $Vend::FinalPath =~ m{^/admin/}; return; } EOR catalog.cfg: Autoload set_pragma_max_matches
- Loading branch information