dbTalk Databases Forums  

Update Statistics

comp.databases.sybase comp.databases.sybase


Discuss Update Statistics in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pater
 
Posts: n/a

Default Update Statistics - 12-10-2003 , 03:18 AM






Hi,

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?

TIA,
ViBart



Reply With Quote
  #2  
Old   
Joe Woodhouse
 
Posts: n/a

Default Re: Update Statistics - 12-12-2003 , 05:59 AM






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.)


Reply With Quote
  #3  
Old   
pater
 
Posts: n/a

Default Re: Update Statistics - 12-12-2003 , 09:21 AM



Hi,

Thank You

btw. ASE 12.5 and ASA 7 / 8

ViBart





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.