Closed Bug 497433 Opened 17 years ago Closed 17 years ago

Adding index to test_runs speeds up getTests query

Categories

(Webtools Graveyard :: Graph Server, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: catlee, Assigned: justdave)

Details

Attachments

(1 file)

Adding an index to (test_id, build_id, machine_id) speeds up the getTests query by about 0.7 seconds (about a 35% improvement). I'm not exactly sure why it helps, maybe somebody with more SQL knowledge can chime in?
I think Dave could do this for us since he's been our IT contact. Dave, let me know if I should assign it to someone else, thanks!
Assignee: nobody → justdave
OS: Linux → All
Hardware: x86 → All
It helps because you're running a query that pulls data using those three columns as criteria. Any time you're running queries with the same columns as the criteria frequently, an index of those columns will help your data get located faster. The tradeoff, of course, is the more indexes you add, the more disk space you use, and there's a slightly (but pretty much imperceptibly) longer delay on updates/inserts as the index has to be updated. Where's the code this patch is against? I need to know what table this is on to apply it to the databases.
Chris, can you provide the SQL to run this against an already existing graphserver database?
I used this: alter table test_runs add index test_id_3 (test_id, machine_id, build_id); The patch is against sql/schema.sql in the graphs database.
Applied to production: mysql> alter table test_runs add index test_id_3 (test_id, machine_id, build_id); Query OK, 937284 rows affected (25.48 sec) Records: 937284 Duplicates: 0 Warnings: 0 Appears to already exist on stage.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: