Large select list, speed issues


#1

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#2

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

#3

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#4

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#5

I haven’t used it yet, but maybe app/script/performance/profiler will
help you
learn what’s consuming all that time.

SteveT


#6

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


#7

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#8

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