
Standard indexes in Oracle Database are B-Trees. This may reduce the amount of work needed to execute the query.Ī database index stores the values from the indexed columns and points to the rows with these values in the table. For searches that return few rows, inspecting every single row is clearly a huge waste of effort.Ĭreating an index on columns in the WHERE clause of a query enables the database to only read rows matching the search criteria. And returns those rows where this is true. This means the database reads every single row in the table and every block ( up to the high water mark). Select /*+ gather_plan_statistics */count(*) from bricks So all queries against it will do a full table scan: select /*+ gather_plan_statistics */count(*) from bricks įrom table(dbms_xplan.display_cursor(:LIVESQL_LAST_SQL_ID, format => 'IOSTATS LAST')) There are no indexes on the bricks table.
