Re: find() performance

Charles Lowe
Mon, 18 Dec 2006 05:15:33 -0000

askegg wrote:
> That seems like a reasonable approach to me, assuming you configure the
> routes accordingly.
> Performance will be slower due to the nature of the search, but not by
> much.  I would suggest dropping an index onto the name field.

I''ve forgotten where I saw the post, but it recommended taking the
approach of including the id and the name (which can change). In fact
the name can be arbitrary and can be ignored. ie, allow

/product/1-windows+xp/edit
/product/2-windows+98

etc.

Then you just ignore the non-id part, and have no performance problems,
and the urls will still work if you rename the product.


--
Posted via http://www.ruby-forum.com/.