Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Is SQL 7 optimiszer smart enough ?!

Is SQL 7 optimiszer smart enough ?!

From: Dan G <Gavrilescu.Daniel_at_pmintl.ch>
Date: Fri, 3 Sep 1999 18:11:25 +0300
Message-ID: <7qooh5$h93$1@pollux.ip-plus.net>


Hello all,

I propose all of you one puzzle:
Problem:
Consider one table with col1,col2 (with 23.682 records) with non-cluster index on col2

Run this query with show stat i/o on (in SQL 7):

select col1
from
 table
order by
col2

The result was:
(23682 row(s) affected)

  1. Table 'POS'. Scan count 1, logical reads 23782, physical reads 1175, read-ahead reads 94. in 22 seconds
  2. Table 'POS'. Scan count 1, logical reads 1132, physical reads 628, read-ahead reads 1136. in 7 seconds

Query:

1)Which of the above results have been returned by using table scan and which one by using the index on col2 ? . 2)Does the optimiser used table scan or the index ?.

I am looking forward ... Received on Fri Sep 03 1999 - 10:11:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US