# Survey

**URL:** <https://www.ruby-forum.com/t/survey/124165>\
**Category:** Rails\
**Created:** [December 25, 2007, 11:24pm UTC](https://www.ruby-forum.com/t/survey/124165 "2007-12-25T23:24:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@sandman](https://www.ruby-forum.com/u/sandman)\
**Post date:** [December 25, 2007, 11:24pm UTC](https://www.ruby-forum.com/t/survey/124165/1 "2007-12-25T23:24:06Z")

</div>

hi all,  
sorry for the previous blank post…it was posted accidently…

I have to publish an online survey form which will target a global  
audience.  
I want to incorporate dynamic analysis of the survey results…in other  
words I should be able to interpret the feedback whenever necessary. The  
form has been created using the Rails helper methods - I need tips on  
how to  
analyse the database entries efficiently. Any alternate/ more efficient  
solution would also be welcome.

Thanks,  
Sandip

–  
View this message in context:  
[http://www.nabble.com/survey-tp14497884p14497884.html](http://www.nabble.com/survey-tp14497884p14497884.html)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![sandman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@sandman](https://www.ruby-forum.com/u/sandman)\
**Post date:** [December 26, 2007, 4:33am UTC](https://www.ruby-forum.com/t/survey/124165/2 "2007-12-26T04:33:29Z")

</div>

Quoting sandipfloyd [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> solution would also be welcome.

Since no details of the kinds of analysis are provided, it is rather  
hard to  
give specific advice. Since the data is in a database, any programming  
language or statistical package with an interface/API to the database  
can do  
something. You could do the analysis in Ruby, SQL, C/C++, etc.  
Whatever is  
comfortable.

Jeffrey

---

<div class="post-metadata">

**Author:** ![sandman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@sandman](https://www.ruby-forum.com/u/sandman)\
**Post date:** [December 26, 2007, 5:10am UTC](https://www.ruby-forum.com/t/survey/124165/3 "2007-12-26T05:10:14Z")

</div>

Jeffrey L. Taylor wrote:

> Quoting sandipfloyd [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > solution would also be welcome.

do i get bonus bucks for this???

---

<div class="post-metadata">

**Author:** ![sandman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@sandman](https://www.ruby-forum.com/u/sandman)\
**Post date:** [December 26, 2007, 6:46am UTC](https://www.ruby-forum.com/t/survey/124165/4 "2007-12-26T06:46:10Z")

</div>

On Dec 25, 4:23 pm, sandipfloyd [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have to publish an online survey form which will target a global audience.  
> I want to incorporate dynamic analysis of the survey results…in other  
> words I should be able to interpret the feedback whenever necessary. The  
> form has been created using the Rails helper methods - I need tips on how to  
> analyse the database entries efficiently. Any alternate/ more efficient  
> solution would also be welcome.

How many surveys do you expect to be analyzing (absolute maximum) and  
how many fields are there per survey? Also, what types of analysis  
need to be done?

Reason I ask: Ruby is not designed for efficient execution, it’s  
designed for efficient development.

One tip I can give you straight off: don’t use SQLite (default for  
Rails 2), it’s very inefficient especially when indexes are needed.  
Use MySQL.

Another issue for efficiency in data analysis: Rails has no way to  
specify types of indexes with add\_index in migrations. add\_index  
simply uses whatever the default index is in that particular database  
which is normally a hash – good for unique lookups, bad for range  
lookups. You’ll need to set all indexes that require range lookups  
manually in the database to tree indexes. (I am in the process of  
creating and recommending a patch to add index type selection to the  
add\_index method)

–  
Travis
