Hi All,
What is the default index used by a query written in sql and executed on progress database
Regards,
Ezaz
SQL uses a cost based optimizer. Have you ever run UPDATE STATISTICS for this db?
This kbase is a good starting point: knowledgebase.progress.com/.../20992
Or enter "update statistics" in the search box at: knowledgebase.progress.com/pkb_Home
If there are no indexes on a table, then SQL uses default index which is on ROWID. If there are multiple indexes defined on the table, then as [mention:dc2ff39fa15940708b78017f1194db6a:e9ed411860ed4f2ba0265705b8793d05] said, SQL uses a cost based optimizer to select the best index.
From SQL Development guide:
"Selecting an index
When the list of candidate index predicates has been determined, the optimizer selects which, if any, it will use for an index scan operation.
This selection is cost-based. The optimizer computes the cost for each of the index candidates and the cost for a table scan using the default index. The candidate with the lowest cost is chosen."
the query analyzer does not have a concept of “default index”. in the absence of other choices, it may use a table scan which does not use an index at all or it may use the so-called "primary index" if one exists.