drill icon indicating copy to clipboard operation
drill copied to clipboard

Apache Drill Query Execution PLAN Doesn't use mongo db index

Open dwevedivaibhav opened this issue 2 years ago • 1 comments

Hi Team,

I am trying to execute the millions of record query from mongo db storage with timestamp filter, it getting slow even though i created the index of timestamp in mongo collection, but its taking so long time to execute and some time time its failing also due to huge record.

Please find the sample query which i am executing from apache drill

select * FROM mongo.sampletable WHERE SentTime >= TO_TIMESTAMP('2023-08-10 00:00:00', 'yyyy-MM-dd HH:mm:ss') AND SentTime < TO_TIMESTAMP('2023-08-17 00:00:00', 'yyyy-MM-dd HH:mm:ss') LIMIT 10

dwevedivaibhav avatar Aug 25 '23 08:08 dwevedivaibhav

I wonder if your constant timestamp expressions are being folded by the planner. Do you get the same performance from the next query?

SELECT * FROM mongo.sampletable
WHERE SentTime >= TIMESTAMP '2023-08-10 00:00:00'
AND SentTime < TIMESTAMP '2023-08-17 00:00:00'
LIMIT 10

jnturton avatar Aug 25 '23 08:08 jnturton

Yes Same problem @jnturton

dwevedivaibhav avatar Apr 24 '24 09:04 dwevedivaibhav

Duplicate of #2906.

jnturton avatar Apr 25 '24 06:04 jnturton