Page MenuHomePhabricator

prop module is using pageids not titles for sorting
Closed, DeclinedPublic

Description

The prop modules are using pageids for internal order, not the title (alphabetically).

You will see this, when using generator with a prop (example url): The <templates> tag is first added to the <page> tag with the lowerst pageid, not for the first <page> tag in the list.

In my opinion is that not a intuitive order. It is possible to change that order? Thanks.


Version: unspecified
Severity: enhancement
URL: http://en.wikipedia.org/w/api.php?action=query&generator=allpages&gaplimit=50&gapfrom=Main%20Page&prop=info|templates

Details

Reference
bz26311

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:21 PM
bzimport set Reference to bz26311.

(In reply to comment #0)

In my opinion is that not a intuitive order.

I agree.

It is possible to change that
order?

Not without melting the database :(

Bryan.TongMinh wrote:

We are sorting on page_id, because that is an indexed field in the database. It could be possible to sort on (page_namespace, page_title) probably as that is indexed as well. However I don't know what performance consequences that has. Intuitively I would say that sorting on an int is faster than on a varchar.

(In reply to comment #2)

We are sorting on page_id, because that is an indexed field in the database. It
could be possible to sort on (page_namespace, page_title) probably as that is
indexed as well. However I don't know what performance consequences that has.
Intuitively I would say that sorting on an int is faster than on a varchar.

That's not it. In the case of prop=links, we're sorting by pl_from (which references page_id), then pl_namespace then pl_title. To accomplish the behavior the reporter is asking for, we'd have to sort by (page_namespace, page_title, pl_namespace, pl_title), and sorting on fields spread across multiple tables isn't indexed.

(In reply to comment #1)

(In reply to comment #0)

It is possible to change that
order?

Not without melting the database :(

Thanks for that informationen, that is not possible with the current database layout.

Creating a view with a index of that rows, is not a better solution? Thanks.

Creating a view with a index of that rows, is not a better solution? Thanks.

You can't create indexes on views, AFAIK