Is there a Use No Index hint?

1,151 views
Skip to first unread message

JonW

unread,
Aug 5, 2010, 4:40:30 PM8/5/10
to mongodb-user
We have an index on a field that has 13 of its 6994084 documents that
are too large to fit in index. We don't want to miss these documents
if we query for them, so I was thinking we could test the size of the
field before we query and chose whether to run the query or run the
query with some hint to optimized not to use the index.

Does a hint to bypass the use of an index exist? What would the
syntax be?

thx.

Kyle Banker

unread,
Aug 5, 2010, 4:44:25 PM8/5/10
to mongod...@googlegroups.com
You can pass {"$natural": 1} as a hint to force a table scan.

That said, wondering if there's a better model for this data...


--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
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.


JonW

unread,
Aug 5, 2010, 4:52:28 PM8/5/10
to mongodb-user
You and me both.

Thx for help.

On Aug 5, 1:44 pm, Kyle Banker <k...@10gen.com> wrote:
> You can pass {"$natural": 1} as a hint to force a table scan.
>
> That said, wondering if there's a better model for this data...
>
> On Thu, Aug 5, 2010 at 4:40 PM, JonW <jwoll...@yahoo.com> wrote:
> > We have an index on a field that has 13 of its 6994084 documents that
> > are too large to fit in index.   We don't want to miss these documents
> > if we query for them, so I was thinking we could test the size of the
> > field before we query and chose whether to run the query or run the
> > query with some hint to optimized not to use the index.
>
> > Does a hint to bypass the use of an index exist?  What would the
> > syntax be?
>
> > thx.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mongodb-user" group.
> > To post to this group, send email to mongod...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mongodb-user...@googlegroups.com<mongodb-user%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages