MarkAHershberger has uploaded a new change for review.

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.

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 includes/api/ApiQueryAllImages.php
1 file changed, 167 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/28942/1
--
To view, visit https://gerrit.wikimedia.org/r/28942
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide2ff3dbc3e617e749685d558444854617535bab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_20
Gerrit-Owner: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Martineznovo <[email protected]>

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

Reply via email to