Anomie has submitted this change and it was merged.

Change subject: (bug 27202) Add timestamp sort to list=allimages
......................................................................


(bug 27202) Add timestamp sort to list=allimages

New parameter 'sort' that defaults to 'name' so if not specified it will
act exactly as before.

Changes in the access to $params['dir'] to a boolean variable
$ascendingOrder in a try to be more meaningful.

Some existing filtering parameters are mutually exclusive with new ones.
The reason is because the table is sorted by name, as primary key, while
sorting by timestamp use the timestamp or usertext_timestamp index which
is not the primary key, thus filtering and ordering by different indices
doesn't make an efficient index usage.

Exceptions are:
* mime: disabled in Miser Mode
* size: although there's apparently no use for this when sorting by
  timestamp, there's an index on that and the EXPLAIN doesn't use filesort
  algorythm (unlike other combinations):

EXPLAIN
select img_name, img_user_text, img_timestamp
from image
where img_size>=1000 and img_size<=20000
and img_timestamp > '20120916153705'
ORDER BY img_timestamp\G

* Same for sha1 (see comment on Patchset 1)

In function run:

* Added USE INDEX query options when sort=timestamp to ensure the proper
  index is being used.
* Table selection and result fields moved at top, then filter parameters,
  and finally order by and options.

Parameter description and definition sorted by purpose: sort and dir
first, then pagination, result fields, filters and limit.

Change-Id: Ide2ff3dbc3e617e749685d558444854617535bab
---
M RELEASE-NOTES-1.21
M includes/api/ApiQueryAllImages.php
2 files changed, 173 insertions(+), 50 deletions(-)

Approvals:
  Anomie: Verified; Looks good to me, approved
  jenkins-bot: Verified


--
To view, visit https://gerrit.wikimedia.org/r/23984
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ide2ff3dbc3e617e749685d558444854617535bab
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Martineznovo <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Martineznovo <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to