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

exclude categories: slow for many categories #37

Closed
torvista opened this issue Mar 2, 2024 · 3 comments
Closed

exclude categories: slow for many categories #37

torvista opened this issue Mar 2, 2024 · 3 comments
Labels
bug Something isn't working fix provided A correction has been provided
Milestone

Comments

@torvista
Copy link
Contributor

torvista commented Mar 2, 2024

Not that I use this, but as an example, for a feed of one product, with a p2c table of 387232 entries, feed generation goes from 0 to 14 seconds (on a local pc).

I changed
$where .= ' AND p2c.categories_id NOT IN (' . GPSF_NEG_CATEGORIES . ')';
to
$where .= ' AND p.master_categories_id NOT IN (' . GPSF_NEG_CATEGORIES . ')';
and it was instant again.

Also perhaps some sanitation/checking should be done on that constant....

@torvista
Copy link
Contributor Author

torvista commented Mar 3, 2024

I've modified this, so a category id with a wildcard "12*" will omit all the products in the subcategories. Saves a lot of typing!

@lat9 lat9 added the bug Something isn't working label Mar 18, 2024
@lat9 lat9 added this to the v1.0.2 milestone Mar 18, 2024
@lat9
Copy link
Owner

lat9 commented Mar 18, 2024

... and since p.master_categories_id is where the product's category-description comes from, this makes immense sense!

I'll do the same for the previous 'bit', checking for the GPSF_POS_CATEGORIES.

@lat9
Copy link
Owner

lat9 commented Mar 18, 2024

Not that I use this, but as an example, for a feed of one product, with a p2c table of 387232 entries, feed generation goes from 0 to 14 seconds (on a local pc).

I changed $where .= ' AND p2c.categories_id NOT IN (' . GPSF_NEG_CATEGORIES . ')'; to $where .= ' AND p.master_categories_id NOT IN (' . GPSF_NEG_CATEGORIES . ')'; and it was instant again.

Also perhaps some sanitation/checking should be done on that constant....

You'll know soon enough if the various constants haven't been set correctly; sanitization would be a change over and above the performance-related fix that'll be in this correction.

@lat9 lat9 added the fix provided A correction has been provided label Mar 18, 2024
@lat9 lat9 closed this as completed Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix provided A correction has been provided
Projects
None yet
Development

No branches or pull requests

2 participants