rethinkdb / docs

RethinkDB documentation
http://rethinkdb.com/docs
Apache License 2.0
117 stars 167 forks source link

API: add time complexity to commands #50

Open mglukhovsky opened 10 years ago

mglukhovsky commented 10 years ago

@kevincox said this in the original issue (rethinkdb/rethinkdb#620):

When selecting and designing with a database it is important to know the cost of what queries in what situations. For example, it is often reasonable to use a quadratic query, if you know the size of your dataset will be under a certain size.

It would be very useful to have the expected time complexities of the queries in the documentation and the cases for which the complexity will be different. This is something that Redis does really well for example.

This was met with complete agreement by everyone involved.

danielmewes commented 10 years ago

As a minor improvement until we fully get there, I think we should add a remark to the filter API docs that it performs a full linear scan of the input sequence and doesn't make use of indexes. We should then suggest using get_all as an alternative where possible.

A lot of people coming from an SQL or MongoDB background expect indexes to be used automatically, which is not the case for ReQL.

We already have similar notes the API docs for inner_join and outer_join.