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 !



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

Changing to reflect the actual bug


Oliver Charles made changes - 29/Aug/12 11:38 AM
Field Original Value New Value
Summary Edit search ID is between 123 and 456 displays edits in random order Edit search is not correctly ordered when edits have the same open time
Description Look I search [between edit:18854674 and edit:18854690|http://musicbrainz.org/search/edits?auto_edit_filter=&order=desc&negation=0&combinator=and&conditions.0.field=editor&conditions.0.operator=%3D&conditions.0.name=MONSTRUOUS+DOMINATOR&conditions.0.args.0=285909&conditions.1.field=id&conditions.1.operator=BETWEEN&conditions.1.args.0=18854674&conditions.1.args.1=18854690&field=Please+choose+a+condition] but I don't see neither [edit:18854674|http://musicbrainz.org/edit/18854674] nor [edit:18854690|http://musicbrainz.org/edit/18854690] or actually now *I see them* but it is *RANDOM ORDER* ?! they *should be first and last but they're in middle* ! Look I search [between edit:18854674 and edit:18854690|http://musicbrainz.org/search/edits?auto_edit_filter=&order=desc&negation=0&combinator=and&conditions.0.field=editor&conditions.0.operator=%3D&conditions.0.name=MONSTRUOUS+DOMINATOR&conditions.0.args.0=285909&conditions.1.field=id&conditions.1.operator=BETWEEN&conditions.1.args.0=18854674&conditions.1.args.1=18854690&field=Please+choose+a+condition] but it is *RANDOM ORDER* ?! they *should be first and last but they're in middle* !
Oliver Charles made changes - 29/Aug/12 11:38 AM
Assignee Oliver Charles [ acid2 ]
Oliver Charles made changes - 29/Aug/12 11:38 AM
Status Open [ 1 ] Review Submitted [ 5 ]
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

Oliver Charles made changes - 29/Aug/12 11:43 AM
Fix Version/s 2012-09-17 [ 10152 ]
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.


Oliver Charles made changes - 03/Sep/12 11:25 AM
Status Review Submitted [ 5 ] In Beta Testing [ 10002 ]
Oliver Charles made changes - 17/Sep/12 10:29 AM
Status In Beta Testing [ 10002 ] Closed [ 6 ]
Resolution Fixed [ 1 ]