db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: How to update cardinality statistics
Date Tue, 18 Oct 2005 18:50:01 GMT
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.

The row count is also automatically maintained by Derby - whether
an index exists or not.

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.

Satheesh Bandaram wrote:

> Why exactly do you need to know? Do you suspect they are wrong?
> 
> The row count info is stored internally, not in SYS.SYSSTATISTICS.
> Statistics table contains some more additional statistics, which are
> collected during index creation. (or backing index creation) If you
> create an index on your table, you would see a row there.
> 
> Satheesh
> 
> Radovan Biciste wrote:
> 
> 
>>Hello Satheesh,
>>I'm not sure why I missed that part of documentation, sorry.
>>I've checked SYS.SYSSTATISTICS and it is empty.
>>In the documentation there is also note "If statistics are turned off
>>system wide".
>>Is there any way how to check that my statistics are up to date or at
>>least existing ? I'm running embedded server.
>>Thank you,
>>Radovan
>>
>>
>>Satheesh Bandaram wrote:
>>
>>
>>>Take a look at Tuning Derby manual page:
>>>http://db.apache.org/derby/docs/10.1/tuning/ctunstats848901.html
>>>
>>>This provides several ways to update cardinality information.
>>>
>>>Satheesh
>>>
>>>Radovan Biciste wrote:
>>>
>>>
>>>>Hello,
>>>>I'm very new to derby. I was looking how to update cardinality
>>>>statistics. I have joins between tables with couple hundreds of rows
>>>>and about 600 thousands of rows. I'm using embedded server version
>>>>10.1.1 .0.
>>>>Here is what I've found so far:
>>>>1. UPDATE STATISTICS FOR TABLE mytable is giving me a syntax error.
>>>>Should work on Cloudscape though.
>>>>2. SYSCS_UTIL.SYSCS_COMPRESS_TABLE should update statistics but does
>>>>not make too much sense as I do only inserts. It would take tooo much
>>>>time.
>>>>
>>>>Am I missing something ?
>>>>Thank you very much,
>>>>Radovan
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
> 
> 

Mime
View raw message