On Tue, Jul 1, 2008 at 11:22 AM, Roan Kattouw <roan.kattouw(a)home.nl> wrote:
You wouldn't need to go through the page table
here if you added a
cat_page field to the category table.
Categories are not guaranteed to have associated pages, so we must
keep cat_title. In that case cat_page is redundant and denormalized,
and should only be added if there's some specific performance benefit
to it, which there's not for any application I've heard.
Can be done on cat_title=cl_to too, doesn't really
matter. Joining on
cat_id is cleaner of course, but I don't think it'll be any faster.
Joining on integers is considerably faster than joining on VARCHARs.
In InnoDB, joining on primary keys is considerably faster than joining
on anything else. These shouldn't be neglected, in general. However,
the speed of the join is not the limiting factor here, the problem is
you'll have to filesort the entire category.