Opened 13 years ago

Closed 12 years ago

#142 closed enhancement (fixed)

Make sure we're using 100% efficient queries / indexes

Reported by: Christopher Allan Webber Owned by: Christopher Allan Webber
Priority: trivial Milestone:
Component: programming Keywords: post-sql
Cc: Parent Tickets:

Description (last modified by Christopher Allan Webber)

Every query we use should be able to efficiently use an index, yet
at the same time, we shouldn't create superflous indexes.

Related:


-  `http://kylebanker.com/blog/2010/09/21/the-joy-of-mongodb-indexes/ <http://kylebanker.com/blog/2010/09/21/the-joy-of-mongodb-indexes/>`_
-  `http://www.mongodb.org/display/DOCS/Indexing+Advice+and+FAQ <http://www.mongodb.org/display/DOCS/Indexing+Advice+and+FAQ>`_
-  `http://www.mongodb.org/display/DOCS/Indexes <http://www.mongodb.org/display/DOCS/Indexes>`_

Especially, we should play with using explain:

`http://www.mongodb.org/display/DOCS/Indexing+Advice+and+FAQ#IndexingAdviceandFAQ-Use{{explain <http://www.mongodb.org/display/DOCS/Indexing+Advice+and+FAQ#IndexingAdviceandFAQ-Use%7B%7Bexplain>`_}}.

Assigning to myself, but feel free to claim this if you're excited
about investigating.



Change History (11)

comment:1 by Caleb Davis, 13 years ago

This bug inspired the following update to `#360 </issues/360>`_:

`http://bugs.foocorp.net/issues/360#note-33 <http://bugs.foocorp.net/issues/360#note-33>`_

Here's what I propose:


-  place at least one example of a proper search query in a comment
   alongside a new index
-  assert within a unit test that the example query uses the target
   index
-  do the analogous thing for new queries. name the target index in
   a comment alongside the query, and provide a unit test

These requirements should be met before merging a new index/query.
The merger can then focus on evaluating the cost/benefit. I'll add
unit tests and comments on `#360 </issues/360>`_, at least.

It's rather rigid, I suppose, but I think we need *some* system.
Otherwise this bug could arguably be opened every time someone
makes a new query or index. Under the proposed system, we can be
confident the queries are locked down by unit tests. When we need a
new query we could scan the indices to see if there is a suitable
one already available. Likewise, we would have a way to update all
the appropriate queries if we have to get rid of or change an
index.



comment:2 by Christopher Allan Webber, 13 years ago

I approve of that idea.



comment:3 by Will Kahn-Greene, 13 years ago

Milestone: 0.0.40.0.5
We release 0.0.4, so I'm bumping this to 0.0.5.



comment:4 by Christopher Allan Webber, 13 years ago

Milestone: 0.0.50.1.0

comment:5 by Christopher Allan Webber, 12 years ago

Milestone: 0.1.00.2.0

comment:4 by Elrond, 12 years ago

Milestone: 0.2.00.2.1
Priority: NormalLow
I doubt this gets adressed for 0.2.0.

And as we're concentrating on SQL now, I've set this to Low
priority.
It might get revisited in the SQL world again, with a lot of
different meaning then. But until that time, it's surely Low
priority.



comment:5 by Will Kahn-Greene, 12 years ago

The original url for this bug was http://bugs.foocorp.net/issues/432 .
Relations:
#241: related, #55: related, #31: blocked, #379: blocked

comment:6 by Elrond, 12 years ago

Keywords: post-sql added

comment:7 by Christopher Allan Webber, 12 years ago

This is technically mostly relevant, just in the SQL world now. Elrond and I said we'd discuss soonish.

comment:8 by Elrond, 12 years ago

Milestone: 0.2.1
Type: defectenhancement

We will try to add some indexes to the sql models as we go, but this really is currently low priority and we're not aiming to adress this for the next release (because the next release aims at "get sql running").

comment:9 by Christopher Allan Webber, 12 years ago

Description: modified (diff)
Resolution: fixed
Status: acceptedclosed

I think we put some time into making efficient indexes, and I'm pretty sure that we'll update indexes from real actual experience as we go from here on out. I'm closing this ticket!

Note: See TracTickets for help on using tickets.