Updating the db 6000 times will take few minutes?

Michael S. wrote:

On Sunday 10 May 2009, Jian L. wrote:

so how to do inserts in bulk? by using

Phrase.connection.execute(“insert into phrases(s,frequency,length)
values(’#{phrase}’,#{frequencies[phrase]},#{lengths[phrase]})”)

You might be using the wrong tool and you might be reinventing existing
solutions. Did you have a look at existing text mining tools/frameworks
in Ruby as well as other languages?

i want to do this project and also at the same time let me have a chance
to learn to use the ActiveRecord…

perhaps i can use some kind of “traverse” tool to walk the internet
too…

something that can start at a page and then walk down all page by a
level of 1 or 2 or any number.

it won’t be so hard to write except sometimes the “baseurl” is used and
it is more processing than using absolute url.

On May 10, 4:36 pm, Jian L. [email protected] wrote:

bulk.

so how to do inserts in bulk? by using

Phrase.connection.execute(“insert into phrases(s,frequency,length)
values(‘#{phrase}’,#{frequencies[phrase]},#{lengths[phrase]})”)

basically. you can insert more than one tuple like that (although
perhaps not with all databases)

? or by ar-extensions? can ActiveRecord have a mode for saving without
being in a transaction, or can ActiveRecord has some standard method of
doing bulk inserts?

ar-extensions provides bulk inserts if the db supports it.

Fred