× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
slavakiev reported 2013-09-12T20:21:34Z  · JennyNishimura last modified 2013-09-13T18:07:03Z

Test of COUNT() performance


Dev
Jenny Nishimura
JennyNishimura
QA
Tariq Rahiman
tariqrahiman
Priority Minor
Complexity Unknown
Component MongoSQL
Version Future - .9

Tested Aqua Data Studio Aqua Data Studio 14.0.0-rc-13 Build #: 33892 on Ubuntu 12.04( Mongo DB 2.4.3)

I have other results than in ticket 9058.

I make next test and performance is slow. Also COUNT( ) works faster  through aggregation frame works faster then .count() with $exists and $ne:null.

Make next steps:
1. Generate new collection with 5M records: 
setVerboseShell(false) 
for ( i = 0; i < 5000000; i++ ) { db.largegen.save( { _id: i, ts: new Date() } )};                                                                                   
2. Measure performance in ADS MongoShell
a) using "$exists" : true,  $not:{$type:10} 
var before = new Date()
db.largegen.find({$and:[ { "_id" : { "$exists" : true,  $not:{$type:10} }}]},{_id:1}).count() 
var after = new Date()
Rtime=after- before
Rtime=after- before 
--14491
b) Using "$exists" : true,  $not:{$type:10} } in aggregation framework:
var before = new Date()
db.largegen.aggregate({$match:{$and:[ { "_id" : { "$exists" : true,  $not:{$type:10} } }]}}, { "$group" : { "_id" : 0, "cnt" : { "$sum" : 1 } } },{ "$project" : { "_id" : 0, "cnt" : 1 } } ) 
var after = new Date()
Rtime=after- before
Rtime=after- before
--9164
c)  Currently working regular count( ) with "$exists" : true,  "$ne":null 
var before = new Date()
db.largegen.find({$and:[ { "_id" : { "$exists" : true,  "$ne":null }}]},{_id:1}).count() 
var after = new Date()
Rtime=after- before
Rtime=after- before 

--16645 

3. See  also performance in ADS QA

select count(_id),min(ts) from largegen
--13 sec
go
select count(ts) from largegen
--7 sec
go
select count(_id) from largegen
--16 sec 
go
select count(_id),count(_id) from largegen
--10sec
go

Issue #9971

Closed
 
 
Completion
No due date
No fixed build
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017