Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0022292 | Openbravo ERP | A. Platform | public | 2012-11-14 11:11 | 2013-01-02 11:16 |
|
Reporter | alostale | |
Assigned To | shankarb | |
Priority | normal | Severity | major | Reproducibility | N/A |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | 3.0MP19 | Fixed in Version | 3.0MP19 | |
Merge Request Status | |
Review Assigned To | AugustoMauch |
OBNetwork customer | No |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0022292: Grid: order DESC PK column when other columns are DESC |
Description | When querying for data to be shown in grids, in addition to the columns that participate in the order by, pk column of the queried table is always appended to the order by clause. This is done in order to preserve a constant sorting of records among different pages.
The problem is in case of big volume tables, to be possible to use index for the sorting, it needs to be a multi-column index including both columns: the one we actually want to sort + PK column.
When working with compound indexes the way the column in the index is sorted (asc or desc) matters. Meaning that if the index is created as [colA asc, colB asc], it cannot be used for order by A desc, B asc. But it would be possible to use that index for order by A desc, B desc.
For example:
M_Transaction table with a compound index (date + pk) both asc
order by MovementDate desc, M_Transaction_ID -> index IS NOT applied
order by MovementDate desc, M_Transaction_ID desc -> index IS applied |
Steps To Reproduce | - |
Proposed Solution | Change data source so in case all columns are ordered desc, pk ordering is also desc. In this way we can add just one compound index instead of 2. |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | FixIssue22292.diff (1,728) 2012-11-30 06:06 https://issues.openbravo.com/file_download.php?file_id=5777&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2012-11-14 11:11 | alostale | New Issue | |
2012-11-14 11:11 | alostale | Assigned To | => AugustoMauch |
2012-11-14 11:11 | alostale | Modules | => Core |
2012-11-14 11:11 | alostale | OBNetwork customer | => No |
2012-11-23 08:08 | alostale | Status | new => scheduled |
2012-11-23 08:08 | alostale | Target Version | => 3.0MP19 |
2012-11-30 06:00 | shankarb | Assigned To | AugustoMauch => shankarb |
2012-11-30 06:06 | shankarb | File Added: FixIssue22292.diff | |
2012-12-24 06:34 | shankarb | Issue Monitored: AugustoMauch | |
2012-12-24 06:34 | shankarb | Review Assigned To | => AugustoMauch |
2012-12-24 06:34 | shankarb | Triggers an Emergency Pack | => No |
2012-12-24 06:41 | shankarb | Note Added: 0055162 | |
2012-12-24 06:42 | hgbot | Checkin | |
2012-12-24 06:42 | hgbot | Note Added: 0055163 | |
2012-12-24 06:42 | hgbot | Status | scheduled => resolved |
2012-12-24 06:42 | hgbot | Resolution | open => fixed |
2012-12-24 06:42 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/9c66708f78ef7484efee6c25ecd1f187eda3c599 [^] |
2012-12-26 15:43 | hudsonbot | Checkin | |
2012-12-26 15:43 | hudsonbot | Note Added: 0055212 | |
2013-01-02 11:16 | AugustoMauch | Note Added: 0055304 | |
2013-01-02 11:16 | AugustoMauch | Status | resolved => closed |
2013-01-02 11:16 | AugustoMauch | Fixed in Version | => 3.0MP19 |
Notes |
|
(0055162)
|
shankarb
|
2012-12-24 06:41
|
|
Test Plan:
1. Open any window.
2. Order a column in grid in descending.
3. Debug in buildQuery() method in DataEntityQueryService.java.
4. The where clause that is generated will be 'COLUMN_NAME desc, id desc'. |
|
|
(0055163)
|
hgbot
|
2012-12-24 06:42
|
|
Repository: erp/devel/pi
Changeset: 9c66708f78ef7484efee6c25ecd1f187eda3c599
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Fri Nov 30 10:36:22 2012 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/9c66708f78ef7484efee6c25ecd1f187eda3c599 [^]
Fixes Issue 0022292: Order PK column in DESC when other columns are DESC
In Grid, ordering primary key column in descending when all other order by columns are in descending.
This is done to use the index for sorting.
---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
|
|
|
|
|
|
|
Code reviewed and verified in pi@6735d51a4790 |
|