count acting as find(:all)

1 view
Skip to first unread message

Allan

unread,
Aug 28, 2008, 4:17:42 PM8/28/08
to ambition.rb
Hi,

I'm doing a count of a large data set:

RegressionData.count

which I expect to emit the SQL (using MySQL):

SELECT count(*) AS count_all FROM `regression_data`

but instead I get

SELECT * FROM `regression_data`

when using ambition and given that there are 130K entries it's a bit
slow!

RegressionData.size and RegressionData.length do a similar query.

Any ideas?

Allan

Ben Hoskings

unread,
Aug 31, 2008, 9:50:22 AM8/31/08
to ambition.rb
I'm having the same problem. I've done a little digging and I think
the problem is within Ambition::API#size, but I can't remember as I've
since patched my local copy of ambition.

I'm also having problems with record.association.count, where
association is a has_many - I'm getting a 'wrong number of arguments'
on that. That may well not be an ambition problem, but I thought it
was worth mentioning all the same.

Cheers
Ben

Allan

unread,
Sep 1, 2008, 5:50:21 PM9/1/08
to ambition.rb


On Aug 31, 8:50 am, Ben Hoskings <b...@hoskings.net> wrote:
> I'm having the same problem. I've done a little digging and I think
> the problem is within Ambition::API#size, but I can't remember as I've
> since patched my local copy of ambition.

Are your patches in Github? If so I can check them out and report
back.

Allan

Ben Hoskings

unread,
Sep 1, 2008, 9:18:26 PM9/1/08
to ambit...@googlegroups.com
Yep—

http://github.com/benhoskings/ambition

Sorry about the excess diffs, I stripped trailing whitespace at one
point.

Ben

Chris Wanstrath

unread,
Sep 2, 2008, 2:10:55 AM9/2/08
to ambit...@googlegroups.com
If you two want to chat about the future of Ambition sometime in IRC,
I'm defunkt in #github.
--
Chris Wanstrath
http://github.com/defunkt
Reply all
Reply to author
Forward
0 new messages