Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC643D1E3 for ; Mon, 20 May 2013 16:55:45 +0000 (UTC) Received: (qmail 17747 invoked by uid 500); 20 May 2013 16:55:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 17253 invoked by uid 500); 20 May 2013 16:55:39 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 17152 invoked by uid 99); 20 May 2013 16:55:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 May 2013 16:55:38 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jens@couchbase.com designates 206.225.164.29 as permitted sender) Received: from [206.225.164.29] (HELO EXHUB020-2.exch020.serverdata.net) (206.225.164.29) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 May 2013 16:55:33 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.122]) by EXHUB020-2.exch020.serverdata.net ([206.225.164.29]) with mapi; Mon, 20 May 2013 09:55:10 -0700 From: Jens Alfke To: "user@couchdb.apache.org" , "j.jakobitsch@semantic-web.at" Date: Mon, 20 May 2013 09:55:13 -0700 Subject: Re: custom index Thread-Topic: custom index Thread-Index: Ac5Vesn4rd7mLC99SMmyBo5RjqhiFQ== Message-ID: <52D4AC01-CE4B-41A7-ADC8-025301D322D0@couchbase.com> References: <1369034325.1561.8.camel@linux-1rgw.site> In-Reply-To: <1369034325.1561.8.camel@linux-1rgw.site> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On May 20, 2013, at 12:18 AM, J=FCrgen Jakobitsch SWC wrote: > i need to be able to create a custom index (btree) on > what was once a table column.=20 > i saw that there's an geo spatial extension which was always a sign of > custom indizes. > i need to create a special btree (a regex btree) for a certain key in a > json document that does some magic. It depends on how =93custom=94 the index needs to be. As Jonas said, CouchD= B=92s built-in indexing mechanism is called =93views=94. It=92s fairly flex= ible =97 your map function can define any JSON value as a key for a documen= t, and you can later query on specific keys or key ranges. This becomes esp= ecially powerful if you use arrays as keys, as it lets you set up primary/s= econdary search criteria. But views aren=92t all-powerful. Geospatial queries are one example of some= thing regular views can=92t handle, because they require range tests on mul= tiple axes at once. That=92s why they had to be added as a custom index typ= e in CouchDB. I have no knowledge of how custom indexes are added, but I su= spect it=92s difficult (because it=92s rarely done) and it would definitely= require knowledge of Erlang. Why don=92t you describe your requirements in more detail. A lot of the tim= e we can come up with a fairly clean way to implement people=92s indexing n= eeds using regular views =97 they=92re surprisingly powerful. =97Jens=