Inefficient SQL: Selects versions one-by-one

RESOLVED WORKSFORME

Status

()

Bugzilla
Creating/Changing Bugs
RESOLVED WORKSFORME
11 years ago
10 years ago

People

(Reporter: Olav Vitters, Unassigned)

Tracking

({perf})

Details

(Reporter)

Description

11 years ago
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].
(Reporter)

Updated

11 years ago
Summary: Inefficient SQL: Selects components one-by-one → Inefficient SQL: Selects versions one-by-one

Comment 1

11 years ago
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.

Updated

11 years ago
Assignee: general → create-and-change
Component: Bugzilla-General → Creating/Changing Bugs

Updated

11 years ago
Depends on: 372795
(Reporter)

Comment 2

10 years ago
Has since been fixed.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.