Why "full scans are not evil, indexes are not good"

in this article inside asktom page
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:9422487749968
tell about "full scans are not evil, indexes are not good"
someone tell me why for this select mentioned index are not good?

...and if you read next post, nothing is black or white, it is all shades of grey .
This is not because your query will use index that it would be faster, and the example which Tom gave is really explicit :
With index usage 60127 consistent gets, and without index usage 92 consistent gets
Nicolas.
Message was edited by:
N. Gasparotto

Similar Messages

  • Documents are marked for indexing but indexing is not happening

    Hi All,
    I have completed the configuration of Trex 7.10 ; and also I have tested the settings by executing the report "RCF_CHECK_SEARCH_SETTINGSu201D in SE38 and found no errors, but the problem here is documents are marked for indexing but not getting indexed.
    I need some help to resolve this issue
    Regards
    Siva

    Hi Siva,
    This should help http://wiki.sdn.sap.com/wiki/x/gQ8oCw

  • INDEX UNIQUE SCAN instead of   INDEX FULL SCAN or TABLE ACCESS FULL

    I have calculated statistics in all tables and indexes
    I have a table and a view and when I put it
    SELECT *
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
    It’s OK. I NEED IT (INDEX UNIQUE SCAN)
    But If I put
    SELECT A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    In table A make a TABLE ACCESS FULL.
    Then If I put:
    SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
    It’s OK. I NEED IT (INDEX UNIQUE SCAN)
    Finally, If I put other tables and views in the query (I NEED IT)
    For example:
    SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    INNER JOIN TABLE_C….
    LEFT JOIN VIEW_D….
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX FULL SCAN (FIELD_A_TABLE_A_PK)
    I need INDEX UNIQUE SCAN instead of INDEX FULL SCAN or TABLE ACCESS FULL.
    How can obtain it?
    What happens???
    Thanks!

    Notice the difference in cardinality between your two select statements:
    SELECT STATEMENT, GOAL = ALL_ROWS Cost=5 Cardinality=1
    SELECT STATEMENT, GOAL = ALL_ROWS Cost=10450 Cardinality=472161Apparently since the optimizer believed the first statement was going to return one row, it used an index. But in the second statement it believed it was going to return nearly the whole table (didn't you say it had around 500k rows?). Hence full table scan.

  • An index can not being used and still afect a query performance?

    Hi i have a query with a high cost so i created two indexes, A and B, to improve its performance.
    After the creation of the indexes when i reviewed the execution plan of the query the cost had been reduced, but i noticed that the index B is not being used,
    and if i try to force the query to use index B with a HINT the cost increases, so i decided to drop the index B.
    Once i droped the index B i checked the execution plan again and then i noticed that the cost of the query increased, if i recreate the index B the explain plan
    shows a lower cost even though its not being used by the execution plan.
    Does anyone know why is this happening?
    An index can, not being used by the execution plan and still affect a query performance?

    user11173393 wrote:
    Hi i have a query with a high cost so i created two indexes, A and B, to improve its performance.
    After the creation of the indexes when i reviewed the execution plan of the query the cost had been reduced, but i noticed that the index B is not being used,
    and if i try to force the query to use index B with a HINT the cost increases, so i decided to drop the index B.
    Once i droped the index B i checked the execution plan again and then i noticed that the cost of the query increased, if i recreate the index B the explain plan
    shows a lower cost even though its not being used by the execution plan.
    Does anyone know why is this happening?
    An index can, not being used by the execution plan and still affect a query performance?You said that is what is happening, & I believe you.

  • "Tables are not using indexes"-Please help

    We have a new database , version
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Productio
    NLSRTL Version 10.2.0.1.0 - Production
    We have created Indexes for the tables and analysed the table. Problem is , non of the tables are using indexes. Explain paln for the sql queries are showing full table scan.
    Kindly let me know any parameter I have to change or is there any setttings needed on database level?
    Thanks in advance.
    Regards,
    Chotu

    What is your optimizer mode?
    Another question why you want to use indexes? Use of indexes depends,
    Here is a simple example
    test@>ed
    Wrote file afiedt.buf
      1  explain plan for
      2  select c.cname from mytable c, mytable1 m
      3* where c.cname=m.cname
    test@>/
    Explained.
    test@>SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
    PLAN_TABLE_OUTPUT
    Plan hash value: 2460944079
    | Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |              |     8 |    64 |     1   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS     |              |     8 |    64 |     1   (0)| 00:00:01 |
    |   2 |   INDEX FULL SCAN | C_MYTAB_IDX  |     8 |    32 |     1   (0)| 00:00:01 |
    |*  3 |   INDEX RANGE SCAN| C_MYTAB1_IDX |     1 |     4 |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("C"."CNAME"="M"."CNAME")
    15 rows selected.
    test@>explain plan for
      2  select * from mytable;
    Explained.
    test@>SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
    PLAN_TABLE_OUTPUT
    Plan hash value: 1229213413
    | Id  | Operation         | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |         |     8 |    32 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| MYTABLE |     8 |    32 |     3   (0)| 00:00:01 |
    8 rows selected.As you see MYTABLE has an index but it not always uses that index it depends on the need.
    sql queries are showing full table scan this is a not a curse. So unless you are having some problem. You should not change queries only because to avoid full table scans, there is no rule that indexes should always be used in every case.
    Adith

  • Why full index scan is faster than full table scan?

    Hi friends,
    In the where clause of a query,if we give a column that contains index on it,then oracle uses index to search data rather than a TABLE ACCESS FULL Operation.
    Why index searching is faster?

    Sometimes it is faster to use index and sometimes it is faster to use full table scan. If your statistics are up to date Oracle is far more likely to get it right. If the query can be satisfied entirely from the index, then an index scan will almost always be faster as there are fewer blocks to read in the index than there would be if the table itself were scanned. However if the query must extract data from the table when that data is not in te index, then the index scan will be faster only if a small percentage of the rows are to be returned. Consiter the case of an index where 40% of the rows are returned. Assume the index values are distributed evenly among the data blocks. Assume 10 rows will fit in each data block thus 4 of the 10 rows will match the condition. Then the average datablock will be fetched 4 times since most of the time adjacent index entries will not be in the same block. The number of single datablock fetches will be about 4 times the number of datablocks. Compare this to a full table scan that does multiblock reads. Far fewer reads are required to read the entire table. Though it depends on the number of rows per block, a general rule is any query returning more than about 10% of a table is faster NOT using an index.

  • In the attached VI I dont understand why data from the inner case structures are not being transmitted to the array.

    In the attached VI I don't understand why data from the inner case structures are not being transmitted to the array.
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    TEMP.vi ‏25 KB

    It took me some time to figure what you are trying to do but I think I have it now.
    The SR is still required.
    What is happening is your "Bundle By Name" is replacing all of the fields of the cluster, not just the value coming out of the case structure. So to maintain the cluster stuff you do in earlier iterations you can either...
    1) Put the "Index array, Bundle by name, and Replace array" inside the case structure and ONLY bundle the value you are setting in that iteration. (as you will see Tim post shortly)
    OR
    2) Move the Index array before the Case, unbundle all of the fields and feed teh case structure and run them across the case so that ALL of your output tunnels come from the coresponding input tunnel EXCEPT for the filed you are trying to set.
    Ben
    Message Edited by Ben on 05-05-2010 01:31 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Why are the date and time not updating in backups.backupdb folder?

    I just started using Time Machine on my early 2011 MacBook Pro running 10.7.2. After the initial full back-up and first few updates, the backup folder (on an external 1.5 TB Firewire drive) continues to show the original "date modified" of the very first back-up and lists the size as a ridiculous 2.48 GB. (Using BackupLoupe, I know it actually is 280 GB, reflecting the size of my internal HD). Any idea why this folder's info is not updating in the finder (even using "Get Info")? Are my back-ups really there? (It certainly seems so according to BackupLoupe).

    First, the best way to view or restore from your backups is via the Time Machine display, per Time Machine - Frequently Asked Question #15.  Using the Finder is not recommended.
    Do not worry about the dates.  First, the date modified only applies to the "parent" folder; that's not the Backups.backupdb folder, but the one inside it that's named for your Mac.
    Don't worry about the sizes, either.  On Leopard and Snow Leopard, the size of a backup folder was the total size of all the items that were on your Mac at the time of that backup (less exclusions).  On Lion, however, it's the "unique size" -- the size of items that appear only on that backup.

  • Not all albums are syncing with between itunes match and iphone 5.. WHY!!!

    Not all albums are syncing with between itunes match and iphone 5.. WHY!!!

    First, disable iTunes Match on the iPhone. Open the Music app and let the content clear out. Now, in iTunes, disable iTunes Match while holding down the Option key (Shift for Windows). Quit iTunes, wait a few seconds, and re-open it. Turn iTM back on and let it complete it's scan. The songs that are "waiting" ought to get converted to "purchased," "uploaded" or "matched." Once the scan is complete re-enable the service on the iPhone.

  • How come although iPads are getting more powerful, the iOS apps from apple are so mediocre and just not that great? We spend all this money for the latest ipad and all we get is these $5 video and music apps from apple. Why create the iOS platform and onl

    How come although iPads are getting more powerful, the iOS apps from apple are so mediocre and just not that great? We spend all this money for the latest ipad and all we get is these $5 video and music apps from apple. Why create the iOS platform and only offer so so apps like IMovie and GarageBand ? While other developers are offering much better apps like pinnacle studio for video, Cubasis and Auria for music production, apple has not showed much growth in terms of innovation. While there's nothing wrong with making an app like GarageBand where "anyone " can make a song, how about something for real musicians or an app not so basic as it get for video editing? After spending 0ver $700 on an ipad I'd be willing to spend more than $5 for a better video or audio app.

    First, try a system reset although I can't give you any confidence.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  It could take well over an hour!  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore, go into Recovery Mode per the instructions here.

  • Why are most of my keywords not included when I export images?

    Why are most of my keywords not included when I export images?
    Since starting with Lightroom 1, I've entered keywords into either of the two fields between "keyword tags" and "keyword suggestions" in the keywording panel.  I was unaware that some keywords are more equal than others, or that Lightroom offered (or has added?) hierarchy support.
    I recently stumbled into the news (to me) that Lightroom tags can be organized into a hierarchy, so I exported my keywords to a text file to examine.  I hadn't unwittingly created any hierarchies, but an astounding fraction of the keywords were within square brackets.  Sure enough, if I export an image, keywords within square brackets are omitted from the output (jpeg) file.  How nice.  Since I began with Lightroom 1, I've added nearly 1600 keywords.. Too bad most of them are coded wrong... so as not to accompany output that I create.
    1.     What was I supposed to do, as a photographer beginning to use Lightroom, to enter keywords simply but reliably:  what I type is what I get? I'd expected that's what the "just type here" interface would provide.
    I especially dislike obtaining erratic results:  most keywords are in square brackets, but a few are not.  Of course, when I use a simplified interface, I should expect not to have access to some of the options or features.  However, I shouldn't inadvertently trigger undocumented behavior.
    2.     Does the Adobe reference help system say how to enter keywords simply and reliably, in its documentation of the keywording panel? I don't find my answer under the Keywords topic, within Home / Using Photoshop Lightroom 3 / Organizing photos in the catalog.
    (I NOW realize that the instructions for the "Create/Edit keyword tags" dialog mention exporting. However, that's not the method I was using.)
    Dick Rawson

    I'm afraid that I distracted you with my background mention of hierarcharial keywords; I'm not asking about them.
    I've entered keywords for several years of using Lightroom.  Suddenly, this week, I find that most (yet not all) of them have the attribute of "don't include the keyword in an exported file's metadata."  I never intended to ask for that; I thought all keywords will stay with the file and its offspring, and that's what I wanted.
    So I'm asking:
    1.     What did I do "wrong" to induce Lightroom to give the keywords that attribute? I never intended to ask it to.
    2.     Where does Adobe document how to enter keywords reliably so that they stay with the file on output?  I can't find that Adobe does.
    > Can you be more clear about keywords in square brackets? I know when you export the keywords as a list you can get a normalized data file that uses punctuation and tabs as delimiters...
    I did export the keywords into such a list:  most keywords in the plain-text list have square brackets surrounding them, indicating keywords that will be omitted from metadata of any image that Lightroom exports.
    My concern is not that the brackets are there.  They encode the attribute of "don't include the keyword in an exported file's metadata," and recognizing that attribute concerns me.
    > ...but I've never seen keywords in image files or in the interface rendered so.
    I haven't, either.
    Dick Rawson

  • Why last  4 lines of  every page in sap script are not coming ,it is not o

    pls give some solution why last  4 lines of  every page in sap script are not coming ,it is not over flowing to next page even? it is any page format related problem or coding problem?

    Hi,
    Use PROTECT ENDPROTECT statement it displays hole paragraph in to the single page and also to over come this issue.
    Regards
    Md.MahaboobKhan

  • HT201317 why the last photos in photo stream are not sync with my iPad?

    why the last photos in photo stream are not sync with my iPad?

    Photostream only syncs photos over Wi-Fi, make sure you are connected to Wi-Fi to begin with.
    Photostream only syncs when the camera app is closed, ensure it is closed.
    Photostream only syncs when the battery is above 20%, try recharging the device
    Try disabling photo stream on your device (settings > iCloud), restarting your device and then re-enabling photo stream.
    If this doesn't help you may need to reset photo stream. You can do this at icloud.com by clicking on your name in the top right corner and then the advanced settings in the pop-up dialogue box that appears.
    Note: disabling photostream and re-enabling it will result in any photos that are currently in the photostream album on your device, that are older than 30 days old, not being added back.

  • Why are some of my movies not syncing while others are? All of my movies are in m4v form, and some of them sync but some of them don't.

    Why are some of my movies not syncing while others are? All of my movies are in m4v form, and some of them sync but some of them don't. Also, when i try to play my movies on my mac AND ipod, some of my movies just randomly freeze and wont let me continue watching. I dont understand why its doing this.

    iTunes: May be unable to transfer videos to iPhone, iPad, or iPod - http://support.apple.com/kb/TS1497

  • Why are some of my songs not in order in my albums?

    I was wondering why are some of my songs not in order in my albums? This wasn't a problem when I first used i-tunes, but I had to download a newer version of i-tunes to get my sister's ipod to work.  For Example my album "AC DC Live" has track #3 Back in Black as the first song listed.  How can this be fixed?

    Hello igho234,
    Thank you for contacting Apple Support Communities. You don't mention how those songs got onto your playlist, but this article may address your issue, if they were imported from a third-party application or CD.
    iOS: Songs or other audio content are skipped during playback
    http://support.apple.com/kb/TS3159
    Regards,
    Jeff D.

Maybe you are looking for

  • Mac OSX Lion Server Network User Login Issue

    We have in the office a server running Mac OSX Lion, and several network users who've all been running happily for quite a will. About a month ago I was added to the system, and initially we had a few issues relating to the home directory, but we cha

  • Need a good iOS app for measuring image size and app to set printer PPI.

    I'm looking for a photo app for IOS that will give me an accurate representation of the PPI size of my images from my iPhone 6plus as well as my point and shoot camera and also let me set the dpi on my photo printer. Printing photos from the native I

  • Study material for MM

    Hi experts Can anyone please provide study material for learning material management module, which could guide me step by step working in MM module so that i could learn the step by step working of module.. Thanks

  • Event viewer error on perfcoll_OracleBIServer.dll

    Hi Gurus, Pls help me to get the cause of the below error occurred in EventViewer log which caused application outage. the Collect procedure for the Oracle BI server service in DLL "<OBI Install Dir>OracleBI\server\bin\perfcoll_OracleBIServer.dll" ge

  • Is it possible to change the Apple ID for my macbook pro?

    Is it possible to change the Apple ID for my macbook pro? My laptop is currently registered under my husband`s ID, and I would like to change it to my apple ID so I can install changes / updates (as we are now separated). Would appreciate any help.