Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368064

Summary: [UI] Capability index is not used when expanding categories in the UI
Product: [Eclipse Project] Equinox Reporter: Ian Bull <irbull>
Component: p2Assignee: Ian Bull <irbull>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, elias, evan_hughes, gunnar, Lars.Vogel, pascal, tjwatson
Version: 3.8.0 Juno   
Target Milestone: Juno M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patch v1 none

Description Ian Bull CLA 2012-01-06 17:19:00 EST
This is likely even more far reaching than the UI, but I found it there.  

If you search for things in the p2 UI you will notice it's really slow. I spent some time on this today, and it turns out that the problem is in computing categories. When you search for things, all categories are expanded and this is the performance hit we are seeing.

This is because the capability index is never used, and for each category we check each IU to see if it fits.  

It appears that the index is expecting us to look for 'provided capabilities' but instead we are checking to see if an IU 'satisfies' a requirement.  Since this is not something the index knows about, it's not use.

However, if we pull the query apart a bit and realize that it's actually just IRequirements[], we can actually make use of the index and this increases performance dramatically.
Comment 1 Ian Bull CLA 2012-01-06 18:17:56 EST
Created attachment 209163 [details]
Patch v1

Here is a patch. I wonder if someone with more query experience can give this a look over?
Comment 2 Pascal Rapicault CLA 2012-04-30 15:29:02 EDT
*** Bug 263966 has been marked as a duplicate of this bug. ***
Comment 3 Pascal Rapicault CLA 2012-04-30 15:58:40 EDT
Released the attached patch.