El 5/14/09 10:48 PM, Marcus Buck escribió:
If I continue my plain layman approach, I would add a new unique column "page_sortkey" to the table "page", that consists of the (uppercased, str_replaced as described in my previous post, and with whatever replacements else necessary to make it sort properly) pagename, " " (two whitespaces) as separator, and the page_id of the page. The page_id adds uniqueness, the two whitespaces make short words always sort before long words, as " " is the first character byte-order-wise and two whitespaces can never occur in page titles.
That bit's actually quite clever. :) Not sure it's always applicable, but should work in many cases.
Note that generally we don't need to roll our own case-folding and accent-folding and such -- rules and code already exist for standard language-specific sort order generation, they simply need to be implemented if we're going to roll our own index column.
-- brion