In article <br6o8o$6ph$1 (AT) news (DOT) lublin.pl>, pater (AT) pagema (DOT) net
says...
Quote:
Where can I read something about "Statistics" in Sybase ASE and ASA?
Is there any additional options?
-> How may I specify my amount of data (e.g. 10% or n-rows)
-> Is there any possibility to use COMPUTE \ ESTIMATE STATISTICS in
Sybase ?
-> If there is an asymmetrical distribution of data how can I give a
hint for "update statistics" to include that situation? |
I haven't seen anyone else answer this, so I'll have a go.
ASE statistics is a complex subject. You don't say what version
you're running; statistics changed completely in ASE 11.9.2, and
further enhancements have been added more recently in 12.5.0.3. A
good introduction to the latest version is in Chapter 2 of the
Performance & Tuning : Optimizer and Abstract Plans manual at
http://download.sybase.com/pdfdocs/a.../optimizer.pdf
The various options for the update statistics command in ASE are
documented in the manuals at :
http://download.sybase.com/pdfdocs/a...e/commands.pdf
To answer your questions briefly, "update statistics" scanned
100% of the underlying data until ASE 12.5.0.3, when it became
possible to specify a sampling percentage. (Strangely the 12.5.1
Reference Manuals doesn't describe this - you want the "sampling=
[percent]" option.)
As far as I know it is not possible to compute or estimate
statistics, other than interpolating after sampling as above.
This is only available in 12.5.0.3 and above.
If your data is skewed, you can provide a finer granularity for
the statistics by specifying a greater number of histogram steps.
(Only in ASE 11.9.2 and above.) The default is 20 - the greater
the number of steps, the more detail and therefore more chance of
correctly describing skewed data. However there are diminishing
returns, these steps must be scanned for every access to the
table so the number shouldn't be too high. As a rule of thumb I'm
reluctant to go above 100 steps save for the very largest of
tables.
Another option for dealing with skewed data is to prepare your
own statistics. You can edit or create statistics using the
"optima" command, but read up on this clearly, as mistakes could
be very costly.
I don't know much about ASA but as far as I know statistics do
not generally need DBA management. There is a "create
statistics" command but it doesn't take any options.
Regards,
--
Joe Woodhouse
Principal Consultant (former Sybase Technical Evangelist)
Prima Donna Consulting Pty Ltd
(IT. Business. Law. Children's Parties.)