1 Jul 2008 17:22
Re: Schema change : category redirects
Nicolas Dumazet schreef:
> == Original idea : add a cl_final field ==
> <snip>
>
> * Use case #6 :
> When adding a category to a page, you have to fetch its corresponding
> cat_id for cl_to, (fairly easy), but you also have to fetch the right
> cl_final.
> You have to know first, if the category is a redirect. And if I'm
> right, with that schema, the only ways to tell this actually, are to
> retrieve the corresponding page_is_redirect in the page table, or to
> check for an entry in the redirect table.
> I believe that this forces us to compute a page-redirect join on
> page_id + a redirect-category join on page_title for each category
> title (see [3] ). If there's no results for that query, (can be caused
> if {1} the category page does not exist, {2} the category page exist
> but is not a redirect), the category is not a redirect, and else it
> returns us the cat_id for cl_final.
>
You wouldn't need to go through the page table here if you added a
cat_page field to the category table. It's not a big deal, though,
because joining on page_namespace=14 AND page_title=cat_title is pretty
cheap.
> * Use case #7 :
> Easy. SELECT ... FROM category_links WHERE cl_final = ##
>
> == But what about adding a cat_final field instead ? ==
>
> When A redirects to B, all A' category_links entries will share the
> same cl_final field. Being quite unexperienced, and very naive, I may
(Continue reading)
RSS Feed