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 90BF84368 for ; Tue, 17 May 2011 16:51:39 +0000 (UTC) Received: (qmail 12196 invoked by uid 500); 17 May 2011 16:51:38 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12170 invoked by uid 500); 17 May 2011 16:51:38 -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 12162 invoked by uid 99); 17 May 2011 16:51:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 16:51:37 +0000 X-ASF-Spam-Status: No, hits=2.1 required=5.0 tests=FREEMAIL_FROM,HK_RANDOM_ENVFROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of haaiee@gmail.com designates 209.85.216.173 as permitted sender) Received: from [209.85.216.173] (HELO mail-qy0-f173.google.com) (209.85.216.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 16:51:33 +0000 Received: by qyk36 with SMTP id 36so2639574qyk.11 for ; Tue, 17 May 2011 09:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=XYW+NmvfyVVSrnhfjN2ht50164Kse+U1QAW3klAjuak=; b=O790B1jISV+J7beJIGmVFwEMOlc9VDwK/23S1yTUM2KzEWdO4pPZ3XcC9ztH+ucBA/ 1Et12cAw1fl6UEcg+nKNe77UzySPzNORjAzQAbjdW4yrzMDrwBI022CZVHXwKQq7ZQOd Sz8Ap4GZMU1mP4in4LB8H75bvaJgJJvTn0DNs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=uKXLPtEs+dJT0kzsdDBG83/aN+p8y4j61PryslO4zNM67lYSA5je+l0GlGVGJkQi0b lgn+m8ypH9rCFhXOn/YRE4I88URKqwyPWJfIHy6lCWYhPQ/18ocw+UAUvxT/uYr5eXWe gpn2Ut5rBNXf7NrLZ288gC/8H319xPdnWL81c= Received: by 10.229.73.81 with SMTP id p17mr653937qcj.43.1305651072101; Tue, 17 May 2011 09:51:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.230.19 with HTTP; Tue, 17 May 2011 09:50:52 -0700 (PDT) In-Reply-To: References: From: Hendrik Jan van Meerveld Date: Tue, 17 May 2011 18:50:52 +0200 Message-ID: Subject: Re: SQL Query engine with views instead of tables To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e640826e5a6e1604a37b94b1 --0016e640826e5a6e1604a37b94b1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you for the reply Jim, I'll look into Lucene someday. Agree with you that the method for views feels more elegant that for lists. Hendrik On 17 May 2011 08:10, Jim Klo wrote: > You effectively get close to that if you use CouchDB + Lucene. > > Alas not a 'native' solution either, but there is a very well defined que= ry > language for Lucene. > > I've wondered as well how difficult it would be to build a query optimize= r > that would effectively be a dynamic list. One of the strengths relation= al > db's have is the optimizer - essentially predetermining what key to use > before scanning. Couch effectively has this albeit manually via lists. Ma= ybe > I'm missing something myself but, my biggest gripe about lists though is > output in JSON feels like a kludge vs the method used for views. Output > mechanisms should have some cardinality (I think I should be able to emit= in > a list vs having to JSONify output). > > - Jim > > > > On May 16, 2011, at 8:32 PM, Hendrik Jan van Meerveld > wrote: > > > Hi all, > > > > I'm using Couchdb for a new website and loving it. > > The two tier setup with the database directly sending the HTML to the > client > > seems elegant to me. > > > > One thing that I mis is SQL queries. > > Somebody will probably say that I need to learn a new way of thinking, > but > > I've already been using Lotus Notes (another noSQL database) for 3 year= s > and > > I'm still missing SQL. > > > > I've also recently noticed others on this mailing list that would benef= it > > from SQL queries: > > - Alexander Gabriel: "Fetching data: how to > > filter< > http://www.google.nl/url?sa=3Dt&source=3Dweb&cd=3D2&ved=3D0CCEQFjAB&url= =3Dhttp%3A%2F%2Fmail-archives.apache.org%2Fmod_mbox%2Fcouchdb-user%2F201105= .mbox%2F%253CBANLkTik8K6-ndbU9FFE%3DWO-HhcHhUFjejA%40mail.gmail.com%253E&rc= t=3Dj&q=3Dsite%3Ahttp%3A%2F%2Fmail-archives.apache.org%2Fmod_mbox%2Fcouchdb= -user%2F%20Fetching%20data%3A%20how%20to%20filter&ei=3DIuvRTaT9CdGa-wbeoaXI= Cg&usg=3DAFQjCNGkk2mJ-mrIrMyqbAAy4iJ3B5Hjdg&sig2=3Da5J_L6IDGtWBbq__4gng5Q&c= ad=3Drja > > > > " > > - Mauro Fagnoni: "Convert data query into map/reduce > > function< > http://www.google.nl/url?sa=3Dt&source=3Dweb&cd=3D3&ved=3D0CCwQFjAC&url= =3Dhttp%3A%2F%2Fmail-archives.apache.org%2Fmod_mbox%2Fcouchdb-user%2F201105= .mbox%2F%253CBANLkTimvXY0BUoZQ74Z8JPUZGMs4RwPCGw%40mail.gmail.com%253E&rct= =3Dj&q=3Dsite%3Ahttp%3A%2F%2Fmail-archives.apache.org%2Fmod_mbox%2Fcouchdb-= user%2F%20Convert%20data%20query%20into%20map%2Freduce%20function&ei=3Db-vR= TaFahef6BqmwrOUK&usg=3DAFQjCNGwmdgGY_A0f_K-V-_taPVCThWX2w&sig2=3DTeio1B7yQr= UPQManBwdxCQ&cad=3Drja > > > > " > > - Fabio Batalha: "Querying inside a view > > function< > http://www.google.nl/url?sa=3Dt&source=3Dweb&cd=3D1&ved=3D0CBkQFjAA&url= =3Dhttp%3A%2F%2Fmail-archives.apache.org%2Fmod_mbox%2Fcouchdb-user%2F201105= .mbox%2F%253CBANLkTik05ozk49Y-916efxTmDbqc5dZE9A%40mail.gmail.com%253E&rct= =3Dj&q=3Dsite%3Ahttp%3A%2F%2Fmail-archives.apache.org%2Fmod_mbox%2Fcouchdb-= user%2F%20Querying%20inside%20a%20view%20function&ei=3DqevRTfyaBo6e-Qb_6u3U= Cg&usg=3DAFQjCNHqK_A1hrA9Z0j0a0hcuhKK-Qf0fw&sig2=3DaKCwGNxwwlIhoR2OLmiI7A&c= ad=3Drja > > > > " > > > > I found somebody who actually made a front-end SQL engine for Couchdb: > > http://legitimatesounding.com/blog/NoSQL_meet_SQL.html > > > > And there is a popular noSQL database that actually does queries: > > MongoDB > > > > > > > > All this makes me ask the question: "Can SQL language not be added to > > Couchdb?" > > Views are after all very much like tables, so could an existing SQL que= ry > > engine not be rewritten to query tables in Couchdb? > > > > So my question is, does anybody have some thoughts about this? Would it > be > > possible? Would it be difficult to implement in Erlang? > > > > > > Kind regards, > > Hendrik Jan > --0016e640826e5a6e1604a37b94b1--