Quote:
Originally Posted by r937
can we see the query, and the EXPLAIN on the query?
|
SQLAnywhere doesn't seem to have an EXPLAIN function except for the graphical one which kinda makes the data look nasty. However I posted it anyways. If you let me know what you are looking for maybe I can get it easier.
SELECT unit_date,utilization*0.1 as utilization FROM utilization where unit_id= 110188590 and interval = 'D' and system_id = 1803
Node Statistics
*
Estimates
*
Description
*
RowsReturned
266.76
Number of rows returned
PercentTotalCost
0
Run time as a percent of total query time
RunTime
0
Time to compute the results
CPUTime
0
Time required by CPU
DiskReadTime
0
Time to perform reads from disk
DiskWriteTime
0
Time to perform writes to disk
Subtree Statistics
*
Estimates
*
Description
*
RowsReturned
266.76
Number of rows returned
PercentTotalCost
100
Run time as a percent of total query time
RunTime
84.487
Time to compute the results
CPUTime
0.016888
Time required by CPU
DiskReadTime
84.47
Time to perform reads from disk
DiskWriteTime
0
Time to perform writes to disk
DiskRead
5262.9
Disk reads
DiskWrite
0
Disk writes
Optimizer statistics
*
Value
*
Description
*
Estimated cache pages
113868
Estimated cache pages available for this statement
CurrentCacheSize
1840592
Current cache size in kilobytes
ProductVersion
10.0.1.4075
Product version
user_estimates
Override-magic
Controls whether to respect user estimates
ansi_substring
On
Controls behavior of substring function with negative start or length parameter
conversion_error
On
Controls datatype conversion errors
float_as_double
Off
Controls the interpretation of the FLOAT type
ansinull
On
Controls interpretation of NULL values
ansi_integer_overflow
On
Controls whether integer overflow causes an error
ansi_blanks
Off
Controls truncation errors
string_rtruncation
On
Controls truncation errors on INSERT or UPDATE
divide_by_zero_error
On
Controls divide-by-zero errors
sort_collation
Internal
Controls implicit use of SORTKEY on ORDER BY of characters
precision
30
Maximum number of digits in decimal arithmetic
scale
6
Minimum number of digits after decimal point
uuid_has_hyphens
On
Controls format for UUID values
first_day_of_week
7
Sets the numbering of the days of the week
date_order
YMD
Controls order of date components
nearest_century
50
Controls interpretation of two-digit years
date_format
YYYY-MM-DD
Controls format for DATE values
timestamp_format
YYYY-MM-DD HH:NN

S.SSS
Controls format for TIMESTAMP values
time_format
HH:NN

S.SSS
Controls format for TIME values
truncate_timestamp_values
Off
Controls precision of TIMESTAMP values
default_timestamp_increment
1
Number of microseconds to add to TIMESTAMP for next value
return_date_time_as_string
On
Controls how DATE, TIME and TIMESTAMP values are fetched
isolation_level
0
Controls the locking isolation level
optimization_goal
All-rows
Optimize queries for first row or all rows
optimization_level
9
Controls amount of effort made by the query optimizer to find an access plan
optimization_workload
Mixed
Controls whether optimizing for OLAP or mixed queries
max_query_tasks
0
Maximum number of tasks that may be used by a parallel execution plan for a single query
Index Scan Scan consumption using index utilization_unit_date
Table reference
Creator name
dba
Table name
consumption
Estimated rows
38196500
Estimated pages
136162
Estimated pages in cache
18937
Estimated row size (bytes)
35
Buffer fetch
no
Relax cursor stability
no
Lock
Isolation level 0
Scan predicates
system_id= 1803 : 100% Statistics
unit_id = 110188590 : 0.01746% Statistics
interval IS NOT NULL : 100% Statistics | Bounded
interval = 'D' : 4% Statistics
Index
Index name
utilization_unit_date
Clustered index
no
Depth
3
Estimated leaf pages
60342
Sequential Transitions
822
Random Transitions
34951063
Key Values
1527860
Scan
Selectivity
0.017459957% Index
Direction
forward
consumption_miu_id = 110188590 : 0.017459957% Statistics
consumption_date * ASC
Node Statistics
*
Estimates
*
Description
*
RowsReturned
266.76
Number of rows returned
PercentTotalCost
100
Run time as a percent of total query time
RunTime
84.487
Time to compute the results
CPUTime
0.016888
Time required by CPU
DiskReadTime
84.47
Time to perform reads from disk
DiskWriteTime
0
Time to perform writes to disk
DiskRead
5262.9
Disk reads
DiskWrite
0
Disk writes
Index Statistics
*
Estimates
*
Description
*
RowsReturned
6669.1
Number of rows returned