Bug #977
closedFinding sessions viewable by a user is too slow
100%
Description
The query uses several IN and Group By in one very large query and becomes very slow because it needs to determine whether items in a large set of session is in a small list of result. At NIS, this is slow to a still.
Updated by Anchi Cheng about 14 years ago
- Status changed from Assigned to In Code Review
- Assignee changed from Anchi Cheng to Amber Herold
- % Done changed from 0 to 100
Break up the query. The search for projects containing viewable sessions by a user is much faster with the combination of the smaller query results using php code.
Testing:
1. Log in myamiweb as a user in the "users" group who may own a few projects and/or share a few sessions. Users in "administrators" group do not go through this query.
2. New code and old code should give the same project listing but the new code should be faster when there are many projects overall such as NRAMM databases.
Updated by Amber Herold about 14 years ago
Tested. Wow, what a difference! But there is a small problem with my test. A Session that I do not own and is not shared with me showed up in the list.
Updated by Amber Herold about 14 years ago
- Assignee changed from Amber Herold to Anchi Cheng
Updated by Anchi Cheng about 14 years ago
- Assignee changed from Anchi Cheng to Amber Herold
Amber,
It is a database problem. It turns out some experiments were assigned to two projects. 04mar03a belongs to both projectId 5 and 44. Since your test user, as well as mine, owns project 44, the query in inc/leginon.inc (not changed by this bug fix) accepts the session. The query for session selector is rather strange. I think it is that way because of session finder. Don't see how the old getProjects could get around this problem.
I will create an AMI group issue on the database problem that need to be corrected.
Updated by Amber Herold about 14 years ago
cool, I'll run a few more test cases just to be sure nothing else comes up before closing.
Updated by Amber Herold about 14 years ago
- Status changed from In Code Review to In Test
- Assignee changed from Amber Herold to Anchi Cheng
Anchi, I shared my "user" self with a session in NRAMM - Installation Test (234).
When I look for the project in the viewer, it is not there, but the session that I share is in the session list. This seems to be the case with both 2.1.0 and the trunk, so I don't think this is a new problem, but it could be related. Any ideas?
Updated by Anchi Cheng about 14 years ago
- Assignee changed from Anchi Cheng to Eric Hou
It is another of duplicated session problem.
Session DEF_id 6818 and 6819 are both named 09jul08a. In the database 6818 is assigned to installation project while 6819, being an test session during development, has not project assigned. Some kind of mysql error occurred when project/inc/project.inc.php function getExperiments was performed so that it returns 6819.
I've patched up the database by making 6819 (3 images) not 6818 (with no images) is assigned to installation project so that it won't happen in this case.
Eric, do you know why?
Updated by Amber Herold almost 13 years ago
- Status changed from In Test to Closed
- Assignee deleted (
Eric Hou)
I think we can close this out now. Duplicated session errors should be reported in a new issue.