On Jun 30, 2010, at 2:12 PM, Aurimas Likas wrote:

So, Bill, if my only choice is MySQL and if I dont need to join tags table itself (I provide tag IDs to the function selecting products and I dont need any tags data (their IDs are used only for filtering)), I think I can leave pseudo keys (they should be faster than natural ones) and get pretty good performance?? Tags number should be relatively small (up to 10, usually up to 3-5).

Yes, if you know the integer tag_id values, you can continue to use pseudokeys and still eliminate the extra three joins.

There's a performance advantage to using integers instead of strings, because integer comparisons are a bit faster and also the total space required for your index is smaller, so it takes less memory to keep it in cache.

But these advantages are actually pretty small compared to the advantage of avoiding the cost of using a temporary table. So you have already achieved a big win by using joins instead of group by. Any extra benefit from using integer pseudokeys is icing on the cake. :-)

Regards,
Bill Karwin

Reply via email to