Query Pattern recognition of Query Optimizer

55 views
Skip to first unread message

PHeinze

unread,
Apr 16, 2012, 7:17:17 AM4/16/12
to mongod...@googlegroups.com
Hi,

I'm curious how capable the Query Optimizer is in recognizing syntaxical equal queries: http://www.mongodb.org/display/DOCS/Query+Optimizer . The given example is quite simple, and feasible but does the optimizer recognize x : 2, y : 3 and y : 1, x : 3 as equal ( and therefor does something like query normalization) or do I need to take care of the query ordering myself?

Thank you

Andreas Jung

unread,
Apr 16, 2012, 9:24:05 AM4/16/12
to mongod...@googlegroups.com
http://stackoverflow.com/questions/5245737/mongodb-indexes-order-and-query-order-must-match

-aj

> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/SizxsX4nnywJ.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.

--
ZOPYX Limited | zopyx group
Charlottenstr. 37/1 | The full-service network for Zope & Plone
D-72070 T�bingen | Produce & Publish
www.zopyx.com | www.produce-and-publish.com
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


PHeinze

unread,
Apr 17, 2012, 2:09:39 AM4/17/12
to mongod...@googlegroups.com, and...@andreas-jung.com
Thanks for the link,
I think my question wasn't specific enough. I'm aware of the fact which is described in the link you supplied. I'm curious about the fact if the QueryOptimizer is capable of reordering/normalization in order to see if there's already a QueryPlan to use? From the link supplied I don't think this does answer it.


On Monday, April 16, 2012 3:24:05 PM UTC+2, Andreas Jung wrote:
http://stackoverflow.com/questions/5245737/mongodb-indexes-order-and-query-order-must-match

-aj

PHeinze wrote:
> Hi,
>
> I'm curious how capable the Query Optimizer is in recognizing syntaxical
> equal queries: http://www.mongodb.org/display/DOCS/Query+Optimizer . The
> given example is quite simple, and feasible but does the optimizer
> recognize x : 2, y : 3 and y : 1, x : 3 as equal ( and therefor does
> something like query normalization) or do I need to take care of the
> query ordering myself?
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/SizxsX4nnywJ.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to

> mongodb-user+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.

--
ZOPYX Limited           | zopyx group
Charlottenstr. 37/1     | The full-service network for Zope & Plone

D-72070 T�bingen        | Produce & Publish

Kyle Banker

unread,
Apr 18, 2012, 2:07:16 PM4/18/12
to mongod...@googlegroups.com, and...@andreas-jung.com
Yes, the query optimizer will order things appropriately. You don't have to order fields when you construct the query.
Reply all
Reply to author
Forward
0 new messages