Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 21226 invoked from network); 19 Jul 2005 17:26:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jul 2005 17:26:16 -0000 Received: (qmail 61976 invoked by uid 500); 19 Jul 2005 17:26:15 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 61942 invoked by uid 500); 19 Jul 2005 17:26:15 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 61928 invoked by uid 99); 19 Jul 2005 17:26:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2005 10:26:15 -0700 X-ASF-Spam-Status: No, hits=1.6 required=10.0 tests=RCVD_BY_IP,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of gcaddd-derby-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2005 10:26:10 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DuvqQ-0005s5-Uf for derby-dev@db.apache.org; Tue, 19 Jul 2005 19:25:26 +0200 Received: from 12.159.90.110 ([12.159.90.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Jul 2005 19:25:26 +0200 Received: from David.Pickett by 12.159.90.110 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Jul 2005 19:25:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: derby-dev@db.apache.org From: David Pickett Subject: Re: new create-statement Date: Tue, 19 Jul 2005 17:24:04 +0000 (UTC) Lines: 34 Message-ID: References: <22581.1121778791@www23.gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 12.159.90.110 (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Anja, I'm no expert there, but it sounds like you could do this in two pieces: - A 'create table TABLENAME as select . . . .' to build tables out of queries, a very nice and established feature of many RDBMS. It might be easier to do this as a call first, and then figure out how to integrate it into the syntax and update the docs to match. The powers that be might prefer to keep it out of the syntax, if it is not DB2 or SQL-92 or whatever compliant. - A boolean 'sample' stateful function you can put in the 'where' clause to reduce the row count according to your algorythm. You might think it needs some way to tell which state to use, like a detected query number or something, but if you do 5 querys of 15%, the '15% state' can be reused wth no ill effect, so you just need one state per sample rate, and a discard function for aged sample rates, so the state does not grow for every different sample rate used. A look at the Oracle SAMPLE featuremight be worthwhile. They have a block option so you can sample whole blocks (pages) in very large tables, making the sample grow more quickly, but a feature that would be much more invasive to the server code. As I remember, you can sample by percentage or total output rows, but of course it all boils down to a fraction. I think many RDBMS have a row count of some quality in a control table to change count into the fraction. It simplifies things if the sample request of N rows does not guarantee N rows, but rather a close approximation! I am not favoring their semantic style, just pointing to existing feature capabilities. A where clause boolean function is less SQL language invasive, and seems quite sufficient. It seems like the SQL language has a COBOL-esque traditional flavor, where every feature invades the syntax, but modern languages have chosen to work through available syntax where possible, and add extensibility not a new key word every month (or worse yet, a new meaning to an old key word). Good Luck! David