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

Displaying products sorted by creation date timeout in Mongo #8168

Open
stephanegigandet opened this issue Mar 7, 2023 · 1 comment
Open
Labels
caching MongoDB We have 2 mongodb collections: one for current products, and one for obsolete products ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. timeouts

Comments

@stephanegigandet
Copy link
Contributor

Users have reported that home page does not load for them, it was caused by a timeout in MongoDB.

Adding an index seems to have fixed the problem:

> db.products.dropIndex("ciqual_food_name_tags_1_last_modified_t_-1")
{ "nIndexesWas" : 64, "ok" : 1 }
> db.products.createIndex({countries_tags: 1, created_t: -1}, { background: true})
{
	"createdCollectionAutomatically" : false,
	"numIndexesBefore" : 63,
	"numIndexesAfter" : 64,
	"ok" : 1
}

Note that there is already an index on created_t alone, but for some reason it probably was not used. Maybe because it is in ascending order... but it should not matter. :-|

	{
		"v" : 2,
		"key" : {
			"created_t" : 1
		},
		"name" : "created_t_1",
		"background" : true
	}
alexgarel pushed a commit that referenced this issue Mar 9, 2023
Added a new index to solve #8168

As we already have 64 indexes, I removed one for amino_acids which hopefully is not much useful
@teolemon teolemon added caching MongoDB We have 2 mongodb collections: one for current products, and one for obsolete products labels Mar 13, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
caching MongoDB We have 2 mongodb collections: one for current products, and one for obsolete products ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. timeouts
Projects
Status: To discuss and validate
Development

No branches or pull requests

2 participants