Closed Bug 364156 Opened 18 years ago Closed 17 years ago

Inefficient SQL: Selects versions one-by-one

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

2.23.3
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bugzilla-mozilla, Unassigned)

References

Details

(Keywords: perf)

When viewing one bug, the following SQL statements are called.

SELECT value FROM versions
            WHERE product_id = '7'
SELECT versions.value, versions.product_id FROM versions
            WHERE value = '1.0.x'
            AND product_id = '7'
SELECT versions.value, versions.product_id FROM versions
            WHERE value = '1.2.x'
            AND product_id = '7'
(etc)

This should obviously be changed. Ideally to just:
SELECT versions.value, versions.product_id FROM versions WHERE product_id = '7'

For the bug I am testing this on, the product has 15 versions. At least 14
queries are thus avoidable.

For the whole SQL log, please see attachment 248929 [details].
Summary: Inefficient SQL: Selects components one-by-one → Inefficient SQL: Selects versions one-by-one
If that takes more than 0.05 seconds, I'd be amazed. Using new_from_list would be good, and we plan to, but please understand that that would require actual enhancement, architecture-altering code, so I really need to see some *significant* profiling data for this.
Assignee: general → create-and-change
Component: Bugzilla-General → Creating/Changing Bugs
Depends on: 372795
Has since been fixed.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.