Large select list, speed issues


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

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. [email protected] wrote:

right now. There are about 1000 projects. In PHP, the page loaded in about

  • Nic

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

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

SteveT

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: railsexpress.de


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

2006/1/12, Dylan M. [email protected]:

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