on ‎2009 Sep 01 9:10 PM
Hi All,
I am an ABAP programmer and curious to know what is a database statistic and how does it work.
Just want to knot the basic stuff in this regard. Any help would be appreciated.
Thanks-
Request clarification before answering.
> I am an ABAP programmer and curious to know what is a database statistic and how does it work.
>
> Just want to knot the basic stuff in this regard. Any help would be appreciated.
Hi there,
all databases supported by SAP make use of something called "cost-based optimization".
The idea here is that the efficiency of different data access methods say reading a complete table or making use of an index depends on how much data should be processed.
To figure out for a given SQL statement how much data will be processed, the database needs information about the data that is stored in the database. These information are the "database statistics" (sloppy term).
Typical statistics usually include rather rough information like how many rows are stored in a table, how many different values are stored for a specific column, how many pages are used to store the rows etc.
With these information and a set of rules, heuristics and assumptions the database query optimizer makes up a measurement of expected work effort for each possible way to execute a given query.
This measurement of expected work effort is called "costs".
And of course the optimizer should choose the access method with the lowest cost.
As you see, these database statistics are pretty important for good performance.
As you (hopefully) also see - a index access is not always the best option and a full table scan is not always bad
Ok, hope that helps a bit.
regards,
Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.