View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 598 | RackTables | default | public | 2012-09-07 03:51 | 2013-06-09 08:56 |
| Reporter | Address89 | Assigned To | andriyanov | ||
| Priority | normal | Severity | minor | Reproducibility | unable to reproduce |
| Status | closed | Resolution | unable to reproduce | ||
| Product Version | 0.19.14 | ||||
| Summary | 598: slow SQL query for OBJECTS page | ||||
| Description | OBJECTS page SQL runs slowly (with 500 objects takes about 30 seconds to show page) | ||||
| Steps To Reproduce | load 500 objects into racktables and click on OBJECTS page | ||||
| Additional Information | A fix is to tweak SQL as follows: wwwroot/inc# diff -c database.php database.php.201* *** database.php Fri Sep 7 11:26:43 2012 --- database.php.20120907 Mon Sep 3 02:34:10 2012 *************** *** 22,28 **** 'label' => 'label', 'asset_no' => 'asset_no', 'objtype_id' => 'objtype_id', ! 'rack_id' => '(SELECT distinct rack_id FROM RackSpace WHERE object_id = RackObject.id LIMIT 1)', 'rack_id_2' => "(SELECT parent_entity_id AS rack_id FROM EntityLink WHERE child_entity_type='object' AND child_entity_id = RackObject.id AND parent_entity_type = 'rack' ORDER BY rack_id ASC LIMIT 1)", 'Rack_name' => '(select name from Rack where id = rack_id)', 'row_id' => '(select row_id from Rack where id = rack_id)', --- 22,28 ---- 'label' => 'label', 'asset_no' => 'asset_no', 'objtype_id' => 'objtype_id', ! 'rack_id' => '(SELECT rack_id FROM RackSpace WHERE object_id = RackObject.id ORDER BY rack_id ASC LIMIT 1)', 'rack_id_2' => "(SELECT parent_entity_id AS rack_id FROM EntityLink WHERE child_entity_type='object' AND child_entity_id = RackObject.id AND parent_entity_type = 'rack' ORDER BY rack_id ASC LIMIT 1)", 'Rack_name' => '(select name from Rack where id = rack_id)', 'row_id' => '(select row_id from Rack where id = rack_id)', | ||||
| Tags | No tags attached. | ||||
| Attached Files | issue-598.patch (830 bytes)
diff --git a/wwwroot/inc/database.php b/wwwroot/inc/database.php index 0529122..fe295ea 100644 --- a/wwwroot/inc/database.php +++ b/wwwroot/inc/database.php @@ -22,7 +22,7 @@ $SQLSchema = array 'label' => 'label', 'asset_no' => 'asset_no', 'objtype_id' => 'objtype_id', - 'rack_id' => '(SELECT rack_id FROM RackSpace WHERE object_id = RackObject.id ORDER BY rack_id ASC LIMIT 1)', + 'rack_id' => '(SELECT distinct rack_id FROM RackSpace WHERE object_id = RackObject.id LIMIT 1)', 'rack_id_2' => "(SELECT parent_entity_id AS rack_id FROM EntityLink WHERE child_entity_type='object' AND child_entity_id = RackObject.id AND parent_entity_type = 'rack' ORDER BY rack_id ASC LIMIT 1)", 'Rack_name' => '(select name from Rack where id = rack_id)', 'row_id' => '(select row_id from Rack where id = rack_id)', | ||||
| Attached file is the proposed change in unified format. | |
| I don't see any improvement on my 0.20.0 installation while the subquery remained the same as in 0.19.14. Do you have a performance issue with 0.20.0, too? | |
| no feedback provided, closing. | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-09-07 03:51 | Address89 | New Issue | |
| 2012-09-10 19:03 | infrastation | File Added: issue-598.patch | |
| 2012-09-10 19:06 | infrastation | Note Added: 0000781 | |
| 2012-09-10 19:06 | infrastation | Assigned To | => andriyanov |
| 2012-09-10 19:06 | infrastation | Status | new => assigned |
| 2012-09-15 23:46 | andriyanov | Note Added: 0000791 | |
| 2012-09-15 23:47 | andriyanov | Reproducibility | always => unable to reproduce |
| 2013-06-09 08:56 | andriyanov | Note Added: 0001499 | |
| 2013-06-09 08:56 | andriyanov | Status | assigned => closed |
| 2013-06-09 08:56 | andriyanov | Resolution | open => unable to reproduce |