Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fulltext search index: slow query in resetSearchResults() #566

Closed
arhu32 opened this issue May 6, 2014 · 5 comments
Closed

Fulltext search index: slow query in resetSearchResults() #566

arhu32 opened this issue May 6, 2014 · 5 comments
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update

Comments

@arhu32
Copy link

arhu32 commented May 6, 2014

In Magento/CatalogSearch/Model/Resource/Fulltext.php, function resetSearchResults() there are some queries that set the whole column "is_processed" in the table "catalogsearch_query" to 0, e.g.:

$adapter->update($this->getTable('catalogsearch_query'),
    array('is_processed' => 0));

This query is very slow because it possibly needs to update lots of rows every time resetSearchResults() is called. On our server (mage181, multi-store setup, no SSD) with ~40.000 rows in the table, the query took 0.5 seconds and was called regularly during product updates etc.

Fix:

  1. Only update rows that are not already 0:

    $adapter->update($this->getTable('catalogsearch/search_query'),
        array('is_processed' => 0), array('is_processed != 0'));
  2. Add an index to the "is_processed" column in the "catalogsearch_query" table.

This will speed up the query considerably. AFAIK this issue affects all Magento versions, including 1.8.1.0.

@verklov verklov self-assigned this May 14, 2014
@verklov
Copy link
Contributor

verklov commented May 14, 2014

@arhu32, thank you for reporting this to us! We created a ticket in the backlog and will get back to you once the team investigates on this issue.

@bachsh
Copy link

bachsh commented Aug 4, 2014

hey @verklov , was this issue solved in CE 1.9?

@verklov
Copy link
Contributor

verklov commented Aug 10, 2014

Hi @bachsh, I don't think it is solved in CE1.9 already. In any case, once we have a solution for M2, we will have it requested to be ported to M1 by the M1 team.

@maksek maksek added the PS label Nov 12, 2014
@maksek maksek added MX and removed PS labels Jan 8, 2015
@vpelipenko
Copy link
Contributor

Internal ticket: MAGETWO-24366

@vpelipenko vpelipenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Feb 23, 2015
magento-team pushed a commit that referenced this issue May 22, 2015
@kokoc
Copy link
Member

kokoc commented May 27, 2015

@arhu32 The fix is now available in 0.74.0-beta10. Thank you very much for your contribution and continued support to Magento 2! Could you please verify the issue?

magento-team pushed a commit that referenced this issue Sep 7, 2015
[GoInc] Configurable Product Variation Update, manual selection product an association - create grid
okorshenko pushed a commit that referenced this issue Apr 28, 2016
[SUPPORT] MDVA-198: 2.0.5 backlog
okorshenko pushed a commit that referenced this issue Dec 14, 2016
Fixed issue: 
- Split Deployment - scrub sensitive data - override config values by environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update
Projects
None yet
Development

No branches or pull requests

6 participants