Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0022292 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
design defect | [Openbravo ERP] A. Platform | major | N/A | 2012-11-14 11:11 | 2013-01-02 11:16 | |||
Reporter | alostale | View Status | public | |||||
Assigned To | shankarb | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0MP19 | |||
Status | closed | Fix in branch | Fixed in SCM revision | 9c66708f78ef | ||||
Projection | none | ETA | none | Target Version | 3.0MP19 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
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. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
|
![]() |
|
(0055162) shankarb (viewer) 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 (developer) 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 --- |
(0055212) hudsonbot (viewer) 2012-12-26 15:43 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/631fc2e1c525 [^] Maturity status: Test |
(0055304) AugustoMauch (administrator) 2013-01-02 11:16 |
Code reviewed and verified in pi@6735d51a4790 |
![]() |
|||
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 |
Copyright © 2000 - 2009 MantisBT Group |