Why not index every field in a database

Hello,
I hope this is not to much of a newbie question. We have a database that is being used by an application. We do not know which fields are queried on, the application allows for any/all field(s) to be searched on.
Obviously, we can know which fields a particular method is searching on, but there is no requirement for the application developers to keep us up to date on particular query parameters as they add them.
This is a 10g, soon to be 11g, database. Most of the fields are integer with less than 2 digits.
My question is, why not simply index every field, or at least every small integer field?
Thanks,
Sammer

user613816 wrote:
Hello,
I hope this is not to much of a newbie question. We have a database that is being used by an application. We do not know which fields are queried on, the application allows for any/all field(s) to be searched on.
Obviously, we can know which fields a particular method is searching on, but there is no requirement for the application developers to keep us up to date on particular query parameters as they add them.
This is a 10g, soon to be 11g, database. Most of the fields are integer with less than 2 digits.
My question is, why not simply index every field, or at least every small integer field?
Thanks,
SammerIn addition to the unnecessary overhead, there are other considerations that affect whether Oracle will use an index. Just because it is there doesn't mean it will or should be used.
Think about this:
You have a table with a particular field, and an index on that field. You want to add up all the values of that field. Do you think it would be faster for oracle to just read all of those rows in the table and add them up, all of the rows in the index and add them up, or read the index, go find the row in the table, read the index, get another random row in the table...
Now, what if Oracle can read more data at a time if it is getting all the data?
What if you don't want the data from every row in the table? Are you going to create an index for every combination of columns?
What if Oracle stores two digit integers no differently than 4 digit?
What if 99.99% of the values are 0? 100%?
How does Oracle decide the best way to get the data?
These are all questions you can look up online. I would strongly suggest starting with the Oracle Concepts manual for the soon to be version. Once you have done that, you may see you don't have to apologize about newbie questions as long as people see you are willing to put some work into letting them help you.
Some people claim there is no such thing as a stupid question. I think that is just pabulum to keep people from being scared to ask questions when they ought to. The stupid question is the one you ought to have known better before you asked. So your question wasn't a stupid question, but any others you ask now that you know about documentation and online searching may very well be.

Similar Messages

  • Why not partition every table

    Hi ,
    In our project we propse to partition all the tables(Even though they are small which are in MBs) in order to use exchange partiion feature.
    But Our DBAs are saying that Maintainance will be a problem if we create partitions for each and every table.We said ,single tablespace is fine for all the partitions as We thought maintaining different tablespaces is a problem.
    But Still DBAs are not approving it.
    I just want to know what are the disadvantages of partitioning.Why DBAs in general are against the idea of creating partitions.If we use same tablespace for all partitions is there any down side for creating partitions for every table ?
    Is there are disadvantage ?
    Thanks
    Pramod Garre

    Pramod Garre wrote:
    We are planning to use range partitioning (on quarters).
    There is requirement to delete one quarter data from the table and then refresh with new data as and when user update some recored from frontend.this should happen in real time.Sounds like you are having the app trigger partition management ... which doesn't strike me as a good idea.
    It also sounds like you really only have justification for partitioning on a few tables. Far from the "every" table you asked about. And even at that it sounds like your concept of the usage of those partitions may be flawed.
    Why not work with your DBAs instead of looking to strangers for justification to fight them. Sounds to me like they are doing exactly what they were hired to do.
    We thought instead of delete and insert , if we use excahnge partitions , this will be real quick as exchange partition just update the dictionary.
    On these lines,do you think will there be any disadvantages of using partitioning ?
    Note : Delete and Insert is working OK (2 Mins ) as compared to exchange partition ( 20 ms ).
    And Yes,Every table has PK.
    Thanks
    Pramod Garre

  • Why not indexing on every column ?

    If Indexing gives very quick search result, why we should not create index on each and every column of the table? What is limitation of the indexes in the database?

    > If I have only one index on the primary key (say table is EMPLOYEE and
    EMP_ID as primary key), then also there will be a separate table?
    Not necessarily. More on why a PK does not need to be an index below.
    Some comments first.
    There are different types of indexing methods in Oracle. B+tree indexes, bitmap indexes, function indexes, etc. So even though indexes may seem like a "table" - they are not. They use space like tables, but have very different internal structures. Also, it is not the space used by indexes that is the primary "problem" with using indexes.
    Indexes are "good" for searching/reading data. Indexes are "bad" for creating/changing data. When an INSERT/UPDATE/DELETE is done, all these indexes need to be updated. This requires I/O on the indexes to make the changes. I/O is the most expensive operation on a database. And indexes cause more I/O as they need to be maintained. Indexes are therefore expensive things to use.. and thus needs to be used correctly to balance the "good" versus the "bad" of indexing.
    As for primary key issue. There are also, like indexes, different structures that can be used for tables.
    The standard structure is called a heap table. There is also one called index organised table (IOT). This is essentially a merge of a table with a B+tree index.. so your data and index structures are stored together.
    An IOT is a single structure that "contains" both the PK index and the data - for the price of storing the PK columns once. In a heap table the PK index would have been a separate structure and would have duplicated the PK column values.
    IOTs have however limitations due to the physical structure used for an IOT.
    I suggest that you read the [url http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/toc.htm]Oracle® Database Concepts guide - it goes into these in a lot better and clearer detail.

  • Adobe PDF iFilter 9 for 64-bit platforms does not index my PDF files in SQL server database

    hi all
    I need your help
    i have this asp.net site which works with sql server
    it searches a specific word in the database with full text search
    in my database i have a column of type image that holds a PDF file
    i want my SP to search for given word in my file
    so i installed the Adobe Ifilter
    configured it and every thing worked fine
    but after i moved to production Server and installed every thing the same way ...it did not create the index for the pdf files
    i can search for doc and docx and even for xml but not pdf
    i know i installed it correctly since it is working great in the testing environment
    i used this link for the configuration
    http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sql_server_2005.pdf
    the only difference i see between my Testing environment and my Production environment  is that
    my testing has
    windows sever 2003 sp2 with Sql server 2005 64 bit std sp2   -- works fine
    my production  has
    windows sever 2003 R2sp2 with Sql server 2005 64 bit ent sp3  --does not work, does not index my pdf files
    can you tell me if there are problems with some environments ?
    are there any known problems with this Ifilter ?
    what should i do ..

    Thank you
    I opened it in the Acrobat Windows forum
    http://forums.adobe.com/message/2557155#2557155
    meidad Evyoni

  • Messaging Server (sharing folder) searching LDAP is not indexed, why?

    There's an feature of "sharing a mail folder"
    in JMS (Java Messaging Server), whereby
    a user could share a folder with another user.
    But when a user (uid) is entered into
    the "Admission List" box, and the Add button
    is pressed, it failed with some error messages
    Invalid user and Admin Limit exceeded.
    I've asked in the JMS forum and Shane said
    this:
    The "Administrative limit exceeded" error agrees with the Notes=U and etime=12 in the LDAP access log file. The problem is that the search is not indexed and therefore taking long enough to run foul of the timelimit. You will need to consult with Directory Server experts to determine why this search is not indexed and resolve that.
    Could someone enlighten me on what I've
    missed out when I've configured the Ldap
    server during my installation of the JES system

    Here are the extracts of the access and error logs when the "Add" button (after a uid was entered into the box) was clicked.
    Invalid user error line appeared on screen
    Error log:
    WARNING<20805> - Backend Database - search is not indexed base='o=bunet' filter='(&(&(mailUserStatus=active)(objectClass=inetmailuser)(mailHost=jsms.our.domain)(uid=cmtsang))(!(mgmanHidden=true)))' scope='sub'
    Access log:
    SRCH base="o=bunet" scope=2
    filter="(&(&(mailUserStatus=active)(objectClass=inetmailuser)
    (mailHost=netnet.our.top.domain)(uid=cmtsang))(!(mgmanHidden=true)))" attrs="cn mail sn telephoneNumber department"
    RESULT err=0 tag=101 nentries=1 etime=7 notes=U

  • The contained field name "ADTAGR" does not exist in any of the database tab

    hı all
    how can l  solved thıs problem
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
    not caught in
    procedure "PUT_QMFECAT" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    An Open SQL clause was specified dynamically. The contained field name
    "ADTAGR" does not exist in any of the database tables from the FROM clause.
    Information on where terminated
        Termination occurred in the ABAP program "SAPDBZQNQ" - in "PUT_QMFECAT".
        The main program was "ZQMR_BILDIRIM ".
        In the source code you have the termination point in line 732
        of the (Include) program "SAPDBZQNQ".
    Error occurred during batch input processing
        The termination is caused because exception "CX_SY_DYNAMIC_OSQL_SEMANTICS"
         occurred in
        procedure "PUT_QMFECAT" "(FORM)", but it was neither handled locally nor
         declared
        in the RAISING clause of its signature.
        The procedure is in program "SAPDBZQNQ "; its source code begins in line
        715 of the (Include program "SAPDBZQNQ ".
    FORM put_qmfecat.
      DATA: l_tab_fields  TYPE  rsfs_tab_fields.
      DATA: l_ds_clauses  TYPE  rsds_where.
    Dynamische Feldselektion
      MOVE 'QMFECAT_C' TO l_tab_fields-tablename.
      READ TABLE select_fields WITH KEY l_tab_fields-tablename
                                    INTO l_tab_fields.
      IF sy-subrc <> c_rc00.
        CLEAR l_tab_fields.
      ENDIF.
    Dynamische Selektionskriterien
      MOVE 'QMFECAT' TO l_ds_clauses-tablename.
      READ TABLE dyn_sel-clauses WITH KEY l_ds_clauses-tablename
                                 INTO l_ds_clauses.
    DB-Zugriff
      >>>>> SELECT (l_tab_fields-fields) FROM qmfe
      INTO CORRESPONDING FIELDS OF TABLE qmfecat_tab
       WHERE qmnum  =  rqmqmel-qmnum
       AND kzloesch =  space
       AND (l_ds_clauses-where_tab)
       ORDER BY PRIMARY KEY.
    regard sinan
    Edited by: eyup_sinan on Jan 6, 2012 3:21 PM
    Edited by: eyup_sinan on Jan 6, 2012 3:30 PM

    You seem to have made a copy of the standard program. You'll have to make sure that you are handling this field correctly in your code.
    Rob

  • Why metadata index shows up when i plug my ipod into the computer in itunes and how to avoid metadata index showing up it will not allow me to eject from itunes

    why metadata index shows up when i plug my ipod into the computer  in itunes and it will not allow me to eject my ipod from itunes

    Hi donfrommars,
    Welcome to the Apple Support Communities!
    Please use the following article for information and instruction on deleting the U2 album from your devices and account.
    Remove iTunes gift album "Songs of Innocence" from your iTunes music library and purchases
    Have a great day,
    Joe

  • Why do we get an upgrade every 2 years? Why not every year?

    I do not understand why we only get to upgrade every TWO years?!! I don't know if there is a phone on the planet that will honestly last for TWO WHOLE YEARS, unless it is not being used.. AT ALL!!  We pay $160 a month, which totals up to $1,920 a YEAR, and VERIZON wants to tell me, I will have to pay FULL price for another phone before TWO years is up?!?!?!!!  For starters, we have the HTC Thunderbolt.. It worked fine for the first year, but now, it cuts itself on and off, my husbands phone randomly calls people, and he has NEVER used any kind of headset in his phone, but it has headphones at the top of the screen, so he has to talk on speakerphone, my internet doesn't work half of the time, I can't even restart my phone, because when I do, it tells me it has to be activated.. SERIOUSLY VERIZON!!! When our contract is up, we are out of here!! We have CALLED verizon, we have CHATTED with verizon, we have even WENT to verizon, and NOBODY can help us!! NOT ONE SINGLE PERSON!!!! And I will tell everyone I know about the CRAPPY customer service we have gotten as well!!!

    Why not every 6 months.
    My phone normally lasts 2 years. My wife's phone normally lasts 2 years and her current one is now going on 29 months. The phones for my 2 teenage daughters normally last 2 years.
    All of these phones get normal usage and my wife's phone gets above normal usage as she uses the lions share(between 1400 and 2000 minutes) of our minutes in any given month.
    As a family, we use anywhere from 1000-3000 texts in any given month and I am surfing quite regularly on my phone. Phones CAN last 2 years. Out of the 20 or so phones I have had on my account over the past 20+ years, only 1 did not last and that was because it ended up underneath me when falling on the ice.

  • Why i cannot create the sql azure database from my own country 'Nepal' ?. why it is not include in the list of country when we sign up for azure database. :( !!!

    why i cannot create the sql azure database from my own country 'Nepal' ?. why it is not include in the list of country when we sign up for azure database. :(  !!!
    canot we try this new feature ,dosnot we need to try this too..why such discermination for our country nepal. :(

    Hi Anil,
    I am Mahesh from Microsoft Innovation Center. From August 2014 we have made Azure Available to Nepal. You can now directly sign in to azure with your Nepal Based Mobile Number as Verification.
    Thanks for showing your Interest in our Product.
    Mahesh Dahal

  • Why is the "plug in" not working every time i try to stream?

    Why is the "plug in" not working every time i try to stream?

    If you own "Sausage Fattner" you'll find a update in your email that solves this problem.

  • Why is index not being used?

    I need some help in trying to work out why an index isn't being used. I hope someone here can help.
    Table definition for ACT_TOTALS includes
    STARTTIME TIMESTAMP(6)
    There is an index on to_char(starttime, 'YYYY-MM-DD HH24')
    There is a vew definition ACT_TOTALS_HOURLY2 which includes
    select to_char(starttime, 'YYYY-MM-DD HH24') STARTTIMSE
    from ACT_TOTALS
    group by to_char(starttime, 'YYYY-MM'DD HH24'), TRANSTYPE
    I have run a query
    select starttime from ACT_TOTALS_HOURLY2
    where starttime <= to_char(sysdate, 'YYYY-MM-DD HH24');
    The table access comes out as full despite there being > 2 million rows in the table.
    The predicate looks like
    TO_CHAR(INTERNAL_FUNCTION(''STARTTIME''), 'YYYY-MM-DD HH24')<= ..........
    I thinkg the INTERNAL_FUNCTION is an implicit cast from DATE to TIMESTAMP.
    Can anyone please throw any light on why the index on the table wouldn't be used in this case?
    Thanks in advance for any help.

    Can you supply a test case for that?
    This is what I have done to engeneer your case
    drop table t1;
    create table t1 (n1 number, d1 date, STARTTIME TIMESTAMP(6));
    insert into t1(n1,d1, starttime)  select rownum, trunc(sysdate) + rownum, sysdate
    from dual connect by level <= 2e6;
    create or replace view t1_v as select n1, d1, to_char(starttime, 'YYYY-MM-DD HH24') starttimse
    from t1;
    SQL> explain plan for
      2  select starttimse from t1_v
      3  where starttimse <= to_char(sysdate, 'YYYY-MM-DD HH24');
    Explained.
    SQL> select * from table(dbms_xplan.display);
    Plan hash value: 838529891
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |   109K|  1394K|  2004  (14)| 00:00:12 |
    |*  1 |  TABLE ACCESS FULL| T1   |   109K|  1394K|  2004  (14)| 00:00:12 |
    Predicate Information (identified by operation id):
       1 - filter(TO_CHAR(INTERNAL_FUNCTION("STARTTIME"),'YYYY-MM-DD
                  HH24')<=TO_CHAR(SYSDATE@!,'YYYY-MM-DD HH24'))
    Note
       - dynamic sampling used for this statement
    SQL> create index t1_ind on t1 (to_char(starttime, 'YYYY-MM-DD HH24'));
    Index created.
    SQL> explain plan for
      2  select starttimse from t1_v
      3  where starttimse <= to_char(sysdate, 'YYYY-MM-DD HH24');
    Explained.
    SQL> select * from table(dbms_xplan.display);
    Plan hash value: 3884685049
    | Id  | Operation        | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |        |   109K|  1394K|    68   (2)| 00:00:01 |
    |*  1 |  INDEX RANGE SCAN| T1_IND |   109K|  1394K|    68   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access(TO_CHAR(INTERNAL_FUNCTION("STARTTIME"),'YYYY-MM-DD
                  HH24')<=TO_CHAR(SYSDATE@!,'YYYY-MM-DD HH24'))
    Note
       - dynamic sampling used for this statement
    The above selects are done against the view t1_v.
    While the following one is done against the table t1
    SQL> set autotrace traceonly explain
    SQL> select starttime from t1
      2  where starttime <= to_char(sysdate, 'YYYY-MM-DD HH24');
    Execution Plan
    Plan hash value: 838529891
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      | 29875 |   379K|  1790   (4)| 00:00:11 |
    |*  1 |  TABLE ACCESS FULL| T1   | 29875 |   379K|  1790   (4)| 00:00:11 |
    Predicate Information (identified by operation id):
       1 - filter("STARTTIME"<=TO_TIMESTAMP(TO_CHAR(SYSDATE@!,'YYYY-MM-DD
                  HH24')))
    If you can post a clear test case of your issue may be one of us can help you
    Best regards
    Mohamed Houri
    www.hourim.wordpress.com

  • The beta page and Test Pilot page come up EVERY time I use Firefox. Same information so why not allow us to bypass it after the 1st or 2nd or 3rd reading?

    The beta page and Test Pilot page come up EVERY time I use Firefox. Same information so why not allow us to bypass it after the 1st or 2nd or 3rd reading?

    That is not normal behaviour, for possible causes see [[Firefox has just updated tab shows each time you start Firefox]].

  • Why my index is not working

    I have applied an index on a table but after monitoring also i culd see tht it is not being used. Please advice how to make it possible to make use of an index. What types of hints i shuld use ???????????. Please help.

    I would avoid using hints. There could be a very valid reason why your index is not being used. For example if you don't have up to date statistics Oracle may think that it would be faster to use a full table scan vice the index.
    I recommend you do the following:
    1. Ensure that your statistics are up to date
    2. Explain why you think the index should be used. Basically, post the table structure, number of rows, etc. Than post your queries that you think should use this index and their subsequent explain plans.
    This will allow us to discuss the issue further.

  • Why does my final cut pro is not responding every time I open it????!!!!!!

    why does my final cut pro is not responding every time I open it?

    As you give no background info nobody can possibly guess.
    However, have you tried trashing the preferences?
    Many weird things happen as a result of corrupt preferences which can create a vast range of different symptoms, so whenever FCP X stops working properly in any way, trashing the preferences should be the first thing you do using this free app.
    http://www.digitalrebellion.com/prefman/
    Shut down FCP X, open PreferenceManager and in the window that appears:-
    1. Ensure that only  FCP X  is selected.
    2. Click Trash
    The job is done instantly and you can re-open FCP X.
    There is absolutely no danger in trashing preferences and you can do it as often as you like.
    The preferences are kept separately from FCP X and if there aren't any when FCP X opens it automatically creates new ones  .  .  .  instantly.

  • Why does Notes close every time I open it?   I can't access my notes...

    Why does Notes close every time I open it?   I can't access my notes;
    there don't appear to be any.    Help!
    When I check in Settings, Notes has disappeared from the list of Apps
    On my iPhone, yet I didn't delete it.    I had dozens of notes, lots
    of necessary information stored therein. 
    Thanks for any help....

    I was having this issue also. I found this thread and disabling Exchange Notes did the trick. Obviously, this is the solution only if you were using Exchange to begin with.
    If you want to continue to use Exchange notes or perhaps try this to see if it works in general, I found a fix on this site. All works well now.
    1. Delete your exchange account from the Mail, Contacts & Calendars pane in System Preferences.
    2. Go to Finder, click "Go" in the menu bar, click "Go to Folder" and type in "~/Library" (without the quotes) in the box. This will take you to your user Library folder.
    3. Use the search box in the finder and type in "com.apple.notes" and click "Library" in the search bar that appears. This should now find several folders and files related to the Notes app. Rename or delete everything except the help files (with the lifesaver icons on them).
    4. Restart your Mac. Put your exchange account back into System Preferences, you can go ahead and activate the Notes sync service.
    5. Open Notes and it should be working now!

Maybe you are looking for

  • Can't open documents on iMac

    I have Mountain Lion 10.8.5 and Word 2008 12.3.6. Someone is trying to email me a doc file and an els file. Can't open or copy them. Error messages about being in use, read-only or invalid. So he gave me the files on a flash drive and same thing. I k

  • How do I make the audio files on my site download?

    Hi In my site there are links to some audio files. When click the links in chrome or firefox, the audio files start playing straight away. In opera the files download. Internet explorer opens the files in windows media player. How can I make it so th

  • SAP NetWeaver Mobile 7.1 at TechEd 2007

    The next generation platform for enterprise mobility is here, below link would help you through the session details. Don't miss to visit the demo pods at these locations, to see the SAP NetWeaver Mobile 7.1 live in action. /people/community.user/blog

  • Case of lost control files

    Suppose I restored a database and am about to recover it. I realize all control files are lost on disk as well as on tape. Prior to the database crash that needed the recovery, I have no text based control files created(as a backup using ALTER DATABA

  • Experience with Hyperion DRM to Coherence exports.  options

    Hi All. I am working on a project where Hyperion DRM is feeding Oracle Coherence with the slowly changing structures such as GL accounts, budget accounts, costcenters etc. I am looking to find out if anyone has had experience with this type of projec