Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Different index usage by Oracle* optimizer
I'm having 2 similar databases on 2 different UNIX servers, both
`OSF1 V4.0 1091 alpha'.
The database on server 1 is:
Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
while the database on server2 is running with the partitioning option: Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production With the Partitioning option
The table CUSTOMER_ALL contains ~200'000 rows in each database, but I observe the following difference:
server 1 and server 2: select a distinct customer: 1* select customer_id from customer_all where customer_id = 50000 Execution Plan
ard=1 Bytes=26)
The behaviour of the optimizer changes if a range of customers is
selected.
On server 1 the index is still used:
1 select customer_id from customer_all
2* where customer_id > 50000
Execution Plan
s=7162402)
1 0 INDEX (RANGE SCAN) OF 'PKCUSTOMER_ALL' (UNIQUE) (Cost=546 ~
Card=275477 Bytes=7162402)
On server 2 the optimzer makes a full table scan and uses the index
only if I include the hint FIRST_ROWS:
1 select customer_id from customer_all
2* where customer_id > 50000
Execution Plan
s=8901854)
1 0 TABLE ACCESS (FULL) OF 'CUSTOMER_ALL' (Cost=482 Card=34237 ~
9 Bytes=8901854)
On both databases the table customer_all and the index pkcustomer_all are fully analyzed with `ANALYZE ... COMPUTE STATISTICS'.
Another difference that I could find is that on server 1 -the one using the index- the table customer_all uses 5 extents, while on server 2 only 1 extent is used for the table.
My problem is not restricted to the example I've described. The programs show a very poor performance on server 2 because many of the statements cause full table scans.
Questions
Many thanks in advance for any response, Stephan
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Fri Sep 17 1999 - 06:11:55 CDT
![]() |
![]() |