We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 6314 - Optimize SELECT DISTINCT calls that include text-type DB columns
Optimize SELECT DISTINCT calls that include text-type DB columns
Status: RESOLVED WONTFIX
Product: OJS
Classification: Unclassified
Component: General
2.4.2
All All
: P3 normal
Assigned To: PKP Support
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-21 15:38 PST by Alec Smecher
Modified: 2012-12-14 13:43 PST (History)
0 users

See Also:
Version Reported In:
Also Affects:


Attachments
Patch against OJS pre-2.3.4 (8.22 KB, patch)
2010-12-21 15:49 PST, Alec Smecher
Details | Diff
Patch against PKP pre-release (605 bytes, patch)
2010-12-21 15:50 PST, Alec Smecher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Smecher 2010-12-21 15:38:24 PST
Optimize SELECT DISTINCT calls that include text-type DB columns.

Ideally, "SELECT DISTINCT" calls should be avoided unless they're necessary.

As a secondary measure, using SUBSTR on text-type columns limits the maximum length and will help to speed things up.
Comment 1 Alec Smecher 2010-12-21 15:49:24 PST
Created attachment 3401 [details]
Patch against OJS pre-2.3.4
Comment 2 Alec Smecher 2010-12-21 15:50:09 PST
Created attachment 3402 [details]
Patch against PKP pre-release
Comment 3 Alec Smecher 2010-12-21 15:50:21 PST
Leaving open pending testing and back-porting to other apps as needed.
Comment 4 Alec Smecher 2012-12-14 13:43:58 PST
After some consideration, I don't like this solution.

When we rewrite queries etc. for the sake of migrating to grids, SELECT DISTINCT should simply be avoided entirely.