What About Grouping Indexes?


#1

Just a though and maybe some other previewers can voice their opinions on this, but I was thinking that it might be good to allow multiple indexes to be grouped into the same design document for cluster performance considerations.

It could look something like:

CREATE INDEX viewName ON default(field) IN designDocName
// or
CREATE INDEX designDocName.viewName ON default(field)


#2

Good idea, we will do this when we enhance VIEW based indexes further in N1QL. The next major milestone we’re aiming for is secondary indexes.


#3

One thing that I just though of is that this would make some confusing scope chains with the current “DROP INDEX” syntax. For example…

DROP INDEX :pool-name.bucket-name.design-doc-name.view-name

IMO, “DROP INDEX” should require “ON” to specify the bucket in the same way that MySQL requires “ON” to specify the table.

DROP INDEX design-doc-name.view-name ON :pool-name.bucket-name