Forum: Ruby on Rails Large select list, speed issues

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dylan M. (Guest)
on 2006-01-09 20:05
(Received via mailing list)
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails
Nic W. (Guest)
on 2006-01-09 20:17
(Received via mailing list)
Did you take a look at the logs to see what SQL was being generated,
and what percentage of the time it took to create the db request,
render the page etc?

Try to narrow it down a bit.

On 1/9/06, Dylan M. <removed_email_address@domain.invalid> wrote:
> right now. There are about 1000 projects. In PHP, the page loaded in about
>
--
- Nic
Dylan M. (Guest)
on 2006-01-09 20:20
(Received via mailing list)
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails
Dylan M. (Guest)
on 2006-01-09 20:53
(Received via mailing list)
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails
Steve L. (Guest)
on 2006-01-09 21:35
(Received via mailing list)
I haven't used it yet, but maybe app/script/performance/profiler will
help you
learn what's consuming all that time.

SteveT
Stefan K. (Guest)
on 2006-01-11 16:38
(Received via mailing list)
Dylan M. wrote:

>now. There are about 1000 projects. In PHP, the page loaded in about half a
>second, the rails page takes about 4-5 seconds. I tried manually looping and
>generating option tags instead of using the select_tag method, but it wasn't
>much better. Any suggestions?
>
>
I would suggest you should try adding :select => 'id, project_name' to
your find. This way only the id and project_name will be retrieved in
your query, potentially making the instantation of your project records
a lot faster.

-- stefan

--
For rails performance tuning, see: http://railsexpress.de/blog
Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
Dylan M. (Guest)
on 2006-01-12 17:57
(Received via mailing list)
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails
Douglas L. (Guest)
on 2006-01-13 14:35
(Received via mailing list)
2006/1/12, Dylan M. <removed_email_address@domain.invalid>:
>  That fixed the problem perfectly. Weird that i had a full "SELECT *" in PHP
> and it still went fast. Thanks!!
>
>

Take a look at your logs, your SELECT might not have been what you
expected it to be (perhaps someJoins you didn't want?)

Douglas
This topic is locked and can not be replied to.