The query seems a bit strange as the count(*) will only return the number of 
records, yet there is a group by clause which may confuse the optimizer.

Look at the query plan and see if the Mongo storage plug in is potentially 
sending all the records to Drill.

Mongo will likely do a simple record count that will return quickly.

Try the query without the group by clause in Drill, it hold return very 
quickly. Will also be interesting to compare query plans in Drill.

—Andries


On Jan 6, 2015, at 4:08 PM, Adam Gilmore <[email protected]> wrote:

> Hi all,
> 
> I'm trying to test out Mongo with Drill but seem to be running into very
> slow performance.
> 
> I have about 1M documents loaded into Mongo, and I'm doing something as
> simple as:
> 
> select count(*) from mongo.`connect`.events group by collection;
> 
> where "collection" is a string field in the document.
> 
> This takes minutes to complete, which to me seems very strange.
> 
> Any ideas why this would be that slow?  I can run an identical query
> directly on Mongo and it returns in sub-second time.

Reply via email to