Issue Details (XML | Word | Printable)

Key: MBS-5235
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Oliver Charles
Reporter: patate12
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server

Edit search is not correctly ordered when edits have the same open time

Created: 29/Aug/12 07:46 AM   Updated: 17/Sep/12 10:29 AM   Resolved: 17/Sep/12 10:29 AM
Component/s: Data display, Edit system, Search, Templates, User interface
Affects Version/s: None
Fix Version/s: 2012-09-17


 Description  « Hide

Look I search between edit:18854674 and edit:18854690 but it is RANDOM ORDER ?! Those two edits should be first and last but they're in middle !



Sort Order: Ascending order - Click to sort in descending order
Oliver Charles added a comment - 29/Aug/12 11:38 AM

Changing to reflect the actual bug


patate12 added a comment - 29/Aug/12 11:43 AM

Ah OK, so it's sort by date instead of sort by ID.


Oliver Charles added a comment - 29/Aug/12 11:43 AM

patate12 added a comment - 29/Aug/12 11:55 AM

Oliver :

« Sort edits in edit search by open_time and then id

If there are multiple edits with the same open_time (open_time is precise down
to seconds) then the were previously sorted randomly. This adds a little extra
sorting so that these edits are also sorted by ID. »

Why not just sorting by ID ?


Oliver Charles added a comment - 29/Aug/12 02:21 PM

Because open time is a more correct sort parameter.


Ian McEwen added a comment - 30/Aug/12 04:18 AM - edited

Oliver: I think the point he's making is that sorting by id will/should already sort it by open_time anyway, so including both is a bit redundant (and possibly inefficient, depending how smart postgresql's query planner is – I don't remember enough about the implementation of ORDER BY to say).

edit: I doubt it makes that much of a real difference, note, but I do think the question is reasonable, since it's producing extra code that probably doesn't have any actual effect.


Oliver Charles added a comment - 30/Aug/12 09:25 AM

No, id's are simply a unique integer, the fact that they are ordered is accidental. Open time is the correct thing to order on, so that should be our primary mode of sorting.