Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: A question about performance
Not necessarily.
What if 99% of the records have subscr_id <=3D 0? Full table scan would b= e slower.
I just had a situation like this where the cost based optimizer chose a f= ull table scan, even though indices where present. It was much slower tha= n rule-based, due to the cardinality of the index.
-----Original Message-----
From: Singla, Sanjeev SSingla_at_oxhp.com
Sent: Wed, 21 Jun 2000 06:30:06 -0800
To: ORACLE-L_at_fatcity.com
Subject: RE: A question about performance
Full table scan will be faster.
Reason: If it go for index scan it will get the rowids and come back
with those=20
rowids to scan the table because u are selecting all the columns so it h=
as
to do full=20
scan of table also for getting everything. =20
Index scan + full scan of table for actual data. (If going for index sc=
an)
Cheers.
-----Original Message-----
Sent: Tuesday, June 20, 2000 11:35 PM
To: Multiple recipients of list ORACLE-L
=09Hi All:
=09=09There is a question about performance.
=09=09Table name : subscriber , primary key : subscr_id , with
over 5000000 records .
=09=09CASE 1 : select *=20
=09=09=09=09=09from subscriber ;
=09=09=09=09=09(FULL TABLE SCAN)
=09=09CASE 2 : select *=20
=09=09=09=09=09from subscriber
=09=09=09=09=09where subscr_id > 0 ;
=09=09=09=09=09(USE INDEX)
=09=09Could anyone tell me which ones performance is better , or
they are the same ??
=09=09Thank you in advance.
=09=09=09=09=09
Tiffany
E-mail tiffanydu_at_pcdc.com.tw=20
=09=09
--=20
Author: =3D?big5?B?VGlmZmFueSBEdSAoIKf5p0qq4iAp?=3D
INET: TiffanyDu_at_pcdc.com.tw
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). --=20
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
_________________________________________________________________________=__