Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 74807 invoked from network); 18 Oct 2005 23:13:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Oct 2005 23:13:20 -0000 Received: (qmail 42985 invoked by uid 500); 18 Oct 2005 23:13:18 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 42967 invoked by uid 500); 18 Oct 2005 23:13:18 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 42956 invoked by uid 99); 18 Oct 2005 23:13:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Oct 2005 16:13:18 -0700 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.182.144] (HELO e4.ny.us.ibm.com) (32.97.182.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Oct 2005 16:13:18 -0700 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j9INCubg031720 for ; Tue, 18 Oct 2005 19:12:56 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j9INCua2088400 for ; Tue, 18 Oct 2005 19:12:56 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j9INCu8D001164 for ; Tue, 18 Oct 2005 19:12:56 -0400 Received: from [9.72.134.65] (ws420-1.usca.ibm.com [9.72.134.65]) by d01av03.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j9INCt5O001150 for ; Tue, 18 Oct 2005 19:12:55 -0400 Message-ID: <43558159.5020603@sbcglobal.net> Date: Tue, 18 Oct 2005 16:12:25 -0700 From: Mike Matrigali User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: How to update cardinality statistics References: <4353EA29.7070406@softhome.net> <43553F60.5080704@Sourcery.Org> <435543D9.20601@sbcglobal.net> <200510181606.17120.msegel@segel.com> In-Reply-To: <200510181606.17120.msegel@segel.com> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You are right I was unclear. Let me try again. Derby uses existing indexes created by the user to derive histogram information to be used in costing various query plans, and thus in chosing which indexes it uses. This histogram is dynamic and never needs to be updated by the user. All other databases that I have worked on in the past have required users to periodically update histogram based statistics if their data distribution changes. I was trying to point out that this manual update was not necessary in Derby. I also really miss having a single index to search the documents. Michael J. Segel wrote: > On Tuesday 18 October 2005 13:50, Mike Matrigali wrote: > >>I 2nd Satheesh's query, it is useful to know why you care. Derby >>unlike most other database's automatically maintains histogram >>type information about the tables (this does require indexes to >>exist). This information is gathered directly from the indexes, >>and is automatically maintained by Derby. >> > > I believe the issue is that the documentation may be sparse or hard to find. > In fact, a quick check on the 10.1 docs, in the Reference Manual the > description for SYSSTATISTICS is incorrect. (It appears to be a typo as a > replication of SYSSCHEMAS entry. see page 149). > > [Seriously it would be nice if someone created an index for these docs. > (Informix used to have their indexes reference mutiple docs which was a nice > feature...)] > > >>The row count is also automatically maintained by Derby - whether >>an index exists or not. >> > > I don't think that the row count itself is an issue. > > From looking at the original poster, he said he was adding 600 thousand rows > in to the database and was looking for a way to update statistics. Since most > people who are looking at Derby are also familiar with another RDBMS or two, > they are going to try and find if similar functions exist. > > Without going in to an example, how many times have you seen on c.d.i, "Did > you UPDATE STATISTICS..." as a reply to a performance question. > > Going from memory, which is never a good thing to do, after you've tried OTC's > bath tub gin, I believe that Informix's IDS will not use an index but do a > sequential scan if the table has less than 10K rows? (You may want to check > with Mohan, he'd know for sure....) While I may be off on the number of rows, > the point is that IDS will do something to optimize for performance. The > downside is that if you have a rapidly growing/changing database, you may > need to update statistics so that the optimizers will perform correctly. > > [Note: Derby has a much smaller footprint. This would entail that Derby lacks > features/functionality that other databases would have. This is not > necessarily a bad thing....] > > >>A goal of Derby is to be zero-admin so we are interested in problems >>that users encounter which make them think they are required to run >>admin type tools. Do note that Derby does require users to appropriate >>secondary indexes on their tables, once those indexes are created derby >>should be able to automatically pick the correct plan. >> > > > Its a nice goal to be zero admin. however, I wonder if you're implying > something that may be misleading. What indexes exist when I create a table? > You said:"Derby unlike most other database's automatically maintains histogram > type information about the tables (this does require indexes to exist)." > > So if I create a table foo that has column A an integer, and column B a 20 > character text field... What index on table foo exists? >