# Question about performance, which is better?

**URL:** <https://www.ruby-forum.com/t/question-about-performance-which-is-better/114333>\
**Category:** Rails\
**Created:** [September 11, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/question-about-performance-which-is-better/114333 "2007-09-11T14:33:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [September 11, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/question-about-performance-which-is-better/114333/1 "2007-09-11T14:33:35Z")

</div>

Hi, i’ve to make a permalink and i’ve to choose about two options.

- The first one is to make the permalink id-name and save it in the db  
and then search the product using the permalink
- The second one is to make everytime the link with a concatenation of  
strings and then take from the url just the id and search in the db the  
product by id

One is space consuming, the db will grow rapidly (there are really a lot  
of product), on the other hand there is a cpu clock consuming to make  
the url and then take only the id (so a concatenation and then a  
substring)

Which do you think is better about performance? Do you suggest something  
else?

Thanks

---

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [September 11, 2007, 2:39pm UTC](https://www.ruby-forum.com/t/question-about-performance-which-is-better/114333/2 "2007-09-11T14:39:28Z")

</div>

Mix M. wrote:

> Hi, i’ve to make a permalink and i’ve to choose about two options.
> 
> - The first one is to make the permalink id-name and save it in the db  
> and then search the product using the permalink
> - The second one is to make everytime the link with a concatenation of  
> strings and then take from the url just the id and search in the db the  
> product by id
> 
> One is space consuming, the db will grow rapidly (there are really a lot  
> of product), on the other hand there is a cpu clock consuming to make  
> the url and then take only the id (so a concatenation and then a  
> substring)
> 
> Which do you think is better about performance? Do you suggest something  
> else?
> 
> Thanks

why would you need a permalink for at product???

this permanlink-craze is getting out of hand…do you think the users  
are more able to remember

[http://myshop.com/product/12345](http://myshop.com/product/12345)

than

[http://myshop.com/apple-macbook-white-with2g-of-ram](http://myshop.com/apple-macbook-white-with2g-of-ram)

???

Mikkel

---

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [September 11, 2007, 3:04pm UTC](https://www.ruby-forum.com/t/question-about-performance-which-is-better/114333/3 "2007-09-11T15:04:10Z")

</div>

Mikkel B. wrote:

> why would you need a permalink for at product???

search engines ? nicer?

> this permanlink-craze is getting out of hand…do you think the users  
> are more able to remember
> 
> [http://myshop.com/product/12345](http://myshop.com/product/12345)
> 
> than
> 
> [http://myshop.com/apple-macbook-white-with2g-of-ram](http://myshop.com/apple-macbook-white-with2g-of-ram)

actually i don’t think that a user remember the id, he add it in his  
bookmarks or he remember the domain, but all the url…i don’t think  
so… anyway the second explain better than the first, don’t you think?
