We recently installed 1.8 of this module. Now queries like the following represent 7% of our slow queries log:
SELECT * FROM view_view WHERE url LIKE 'node/141014%' AND page = 1;
This query is generated from the _nodewords_detect_type_and_ids() function, which is called via nodewords_get() from hook_menu() for every page (and file, including imagecache files) displayed. The LIKE string query against a non-indexed column is very inefficient, and is affecting our performance.
I modified the code to use the views_get_all_urls() function (which gets its results from cache) instead of doing a sql query, and searching the resulting array. Our performance is now much improved.
I've attached a patch which I hope you'll incorporate into the module.
| Comment | File | Size | Author |
|---|---|---|---|
| nodewords_views_opt.patch | 1.07 KB | prfctns6@gmail.com |
Comments
Comment #1
prfctns6@gmail.com commentedComment #2
Robrecht Jacques commentedFixed. Will be included in 5.x-1.10 released later today. Thanks!
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.