Impact on index

Hi All,
I have a column in a table which is having index.I want to know what will happen to the index when i perform below :
1. I delete a row (will index for the column also going to b deleted)
2. I delete a row having value 101 and again i have inserted the same value.(Will index is dropped when i deleted the row and again going to b created again when i inserted)
3. By truncating we reset the HWM like that can we have any mechanism for index too.
Thanks

In the first place, you don't seem to have good understanding what an INDEX is? In the case of dictionary or any book, you will have index which says which alphabet is in which page etc. This will be an ordered data. In the same way, index is just a lookup table which stored the index column data and their corresponding rowid. If you delete a row, the particular entry is column data and rowid will be deleted from the index and not the index is not dropped. For an insight,
http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96521/indexes.htm
Cheers
Sarma.

Similar Messages

  • Negative performance impact of index

    A SELECT statement I've written references an otherwise unused VARCHAR2 column in a table that defaults to NULL, and which is set by another statement for some (not all) rows to a three-character string (like 'XYZ'). The query takes 2.5 hours to complete, but with an index added on the column, finishes in 2 to 3 minutes. I'm perfectly satisfied with this solution, but my extremely cautious colleagues (one in particular) are concerned that adding an index will negatively impact the performance of other INSERT or UPDATE statements that reference the table but not the column. I think they're being wildly overcautious, that an index on a column that can contain only 2 values will have minimal impact on other DML statements, if any. Am I right? Is there a reference I could consult to settle disputes like this?
    Any opinions would be gratefully accepted.

    djenkins99 wrote:
    Is there a way to measure the impact of an index on inserts and updates? I could generate an explain plan, but I don't know how to translate the results of the explain plan into actual time (seconds less or more it takes a statement to execute). Even with my select statement, the explain plans taken before and after adding the index are definitely different, and the explain plan with the index shows it being used, although the total cost of the query with or without the index is minimally different.The "cost" of INDEX maintenance is not available as separate metric as far as I know.
    It can be obtained indirectly.
    1) CREATE TABLE BENCH(ID NUMBER);
    2) INSERT INTO BENCH SELECT ID FROM MANY_ROWS_TABLE;
    measure how long INSERT takes
    SHUTDOWN IMMEDIATE
    STARTUP
    -- clears SGA of cached rows
    3) TRUNCATE TABLE BENCH;
    4) CREATE INDEX NDX_ID ON BENCH(ID);
    5) INSERT INTO BENCH SELECT ID FROM MANY_ROWS_TABLE;
    measure how long INSERT takes
    the duration difference is cost to maintain the INDEX

  • Impact of index rebuild in publisher database

    Hello,
    I am using transactional replication and want to run purge job on the publisher database. Lets say at the end of purge I am rebuilding all indexes only on those tables where i purged the data from. Now if I rebuild the indexes on the publisher database do
    I need to rebuild the indexes on subscriber too even though I am replicating schema changes?  Also will rebuilding indexes on publisher database or subscriber database break replication (or cause data mismatch?)?
    Thanks for your replies.

    Hi SQLSPUser,
    Besides Prashanth’s post, please note that primary keys are required on tables in transactional publications, so we cannot drop and recreate primary keys on these tables when rebuilding indexes for replication.
    Also you need to rebuild indexes at both publisher and subscriber as the rebuilding process is not replicated.
    Reference:
    Frequently Asked Questions for Replication Administrators
    https://msdn.microsoft.com/en-us/library/ms151740.aspx
    Fragmentation on Replicated Tables
    http://sqlfool.com/2009/01/fragmentation-on-replicated-tables/
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.
    Lydia Zhang
    TechNet Community Support

  • How to catch possible bind variable performance impact during development?

    Since producing load is a problem on development environment and the technics provided with Oracle can capture a parsing problem caused by a bind variable problem only after execution we are looking for pro-active solution like 10g compile time warnings stuff.
    Using binds can have impact on indexed skewed data columns and paritioned tables, so lets just think about a typical oltp environment with always same access path results for similar queries using bind variables.
    Using v$ views or even better dba_hist after 10g or 10046 trace are considered as re-active approaches since they can only be examined on a pre-production loaded environment.
    Is there any tool or approach you are using or may suggest?
    Thank you, best regards.
    Tonguc

    Are you using PL/SQL only?
    If so, I'd look at all the EXECUTE IMMEDIATE's and DBMS_SQL calls throughout the code and determine one by one if they pose a threat. They should be rare, so a simple search against the USER_SOURCE could be sufficient.
    Other programming languages will have different statements to watch out for.
    I am not aware of any tool that does this for you.
    Hope this helps.
    Regards,
    Rob.

  • Performance Impact of Unique Constraint on a Date Column

    In a table I have a compound unique constraint which extends over 3 columns. As a part of functionality I need to add another DATE column to this unique constraint.
    I would like to know the performance implications of adding a DATE column to the unique constraint. Would the DATE column behave like another VARCHAR2 or NUMBER column, or would it degrade the performance significantly?
    Thanks
    Message was edited by:
    user627808

    What performance are you concerned about degrading? Inserts? Or queries? If you're talking about queries, what sort of access path are you concerned about?
    Are you concerned that merely changing the definition of the unique constraint would impact performance? Or are you worried that whatever functional change you are making would impact performance (i.e. if you are now retaining historical data in the table rather than just updating it)?
    Regardless of the performance impact, unique indexes (and unique constraints) need to be correct. If you need to allow duplicates on the 3 current columns with different dates, then you would need to change the unique constraint definition regardless of the performance impact. Fast and wrong generally isn't going to be preferrable to slow and right.
    Generally, though, there probably is no reason to be terribly concerned about performance here. Indexing a date is no different than indexing any other primitive data type.
    Justin

  • Oracle SGA benefits of using indexes

    Goo day people,
    We have been having performance issues and then the SGA was not sized coprrectely.
    The size of the SGA was 720mb so we then pushed it to 4 gig which I blv is enough.
    We then did a run of the tuning advisory on the top sql queries that were top one,
    the advisor then pointed on that we need to use indexes on those queries .
    We then advised the developers that they need to use indexes as it will improve
    performance .. This morning the ADDM pointed out that we need to up the sga
    to 5 Gig and I dont see this a solution to the problem.
    I need to find a note on what benefits does using indexes have on the SGA and the overall perfomance
    so that I can show the business that increasing the SGA wont solve the problem.
    See screen shot below
    erformance Finding Details:
         Database Time (minutes)          33.8
         Period Start Time          10-Aug-2010 10:00:11 o'clock SAST
         Period Duration (minutes)          60.2
         Task Owner          SYS
         Task Name          ADDM:1511773678_1_28498
         Average Active Sessions          0.6
         Finding          The SGA was inadequately sized, causing additional I/O or hard parses.
         Impact (minutes)          14.4
         Impact (%)          [64] [86] 42.8
    Recommendations
    Show All Details | Hide All Details
    Details     Category     Benefit (%) [Sorted in descending order]
    [Select to hide information] Hide
         DB Configuration     [64] [86] 42.8
    Action     Increase the size of the SGA by setting the parameter "sga_target" to 5120 M.
    Thanks
    Sibusiso
    Edited by: 787473 on 10-Aug-2010 02:35

    We have been having performance issues and then the SGA was not sized coprrectely.
    The size of the SGA was 720mb so we then pushed it to 4 gig which I blv is enough.
    We then did a run of the tuning advisory on the top sql queries that were top one,
    the advisor then pointed on that we need to use indexes on those queries .
    We then advised the developers that they need to use indexes as it will improve
    performance .. Yes. As those queries must be missing indexes that would prove to be beneficial. So need to take it query by query and created the required indexes.
    This morning the ADDM pointed out that we need to up the sga
    to 5 Gig and I dont see this a solution to the problem.
    I need to find a note on what benefits does using indexes have on the SGA and the overall perfomance
    so that I can show the business that increasing the SGA wont solve the problem.
    See screen shot below
    erformance Finding Details:
         Database Time (minutes)          33.8
         Period Start Time          10-Aug-2010 10:00:11 o'clock SAST
         Period Duration (minutes)          60.2
         Task Owner          SYS
         Task Name          ADDM:1511773678_1_28498
         Average Active Sessions          0.6
         Finding          The SGA was inadequately sized, causing additional I/O or hard parses.
         Impact (minutes)          14.4
         Impact (%)          [64] [86] 42.8
    Recommendations
    Show All Details | Hide All Details
    Details     Category     Benefit (%) [Sorted in descending order]
    [Select to hide information] Hide
         DB Configuration     [64] [86] 42.8
    Action     Increase the size of the SGA by setting the parameter "sga_target" to 5120 M.One of the biggest impact of indexes (if they fit in the scenario) is in reducing the IO (by avoiding full table scans). Reduced IO means faster system. Absence of indexes would mean that you read lots of data into the memory [buffer cache] and data would flush out quickly too (to make space for the new data), resulting in more IO. So having indexes in place means you only read as much amount of data as required and frequently accessed data stays in the memory.
    Kinda incomplete answer...Lets wait for other experts' comments :)
    Edited by: amardeep.sidhu on Aug 10, 2010 3:23 PM

  • Is it allowed to Create your own indexes on not-udf fields

    Hi all
    I have a customer who ask if it is allowed to add you own clustered indexes on the SBO Tables on the Fields that are not UDF.. Example:
    GO
    CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
    ON [dbo].[RDR1] ([LineStatus],[U_ET_1_3])
    INCLUDE ([DocEntry],[LineNum],[TrgetEntry],[ItemCode],[Dscription],[Quantity],[Price])
    GO
    I have always assumed that such a thing is not legal, but can someone confirm this and perhaps point me to documentation or SAP Note that states this?

    Hi Rasmus,
    Thanks for posting in our SAP Business One forums.
    As you already stated the use of index was not approved to be implemented in Business One databases.
    However, it some specific cases, indexes had improved performance in a very effective way.
    Note 1376447 - "Support scope for SAP Business One database index creation" allows to implement it under SAP' support approval.
    Here an extract from the note.
    While analysing the performance of a customer database if you discover that the addition of an index can improve the performance of the database kindly contact SAP Business One Product Support in order to get approval to add this index to your database.                                                                               
    Please note it is not possible for SAP Business One Product Support to fully test all modules in SAP Business One. As a result we are limited in the testing we can do to verify the overall performance.  In such cases even if the index is approved, SAP is not responsible for the impact the index might have on the overall performance of the database. 
    With kind regards,
    Juan Manuel Marrero
    SAP Business One Forums Team

  • Large tables without clustered indexes -- a bad idea, or ok?

    We have several large tables that don't have clustered indexes, but do have primary keys and assorted other indexes. We're seeing issues that look like they are related to statistics even though there is a nightly update statistics job.
    So my question is, does the existence of a clustered index impact other indexes or the update statistics process? Are our tables ok the way they are?
    Adding clustered indexes would be a big project for non-development-related reasons so I would need to have good reasons to advocate for this.

    RSingh,
    "By default" is a confusing word here. If you do it with WIZARD, I agree. But with T-SQL,there is no space for by default, it can be anything.
    I agree that I assumed here as I wont do much things with wizard. :)
    Try the below:
    --Here by default, its non-clustered
    create table Test_table(Col1 int , Col2 int not null )
    Create clustered index IX__Test_Table on Test_Table (Col1)
    Alter table test_Table
    Add Constraint PK_testTable
    Primary Key (Col2);
    Drop table test_table
    --Here by default, its clustered
    create table Test_table(Col1 int , Col2 int not null Primary key)
    Create index IX__Test_Table on Test_Table (Col1)
    Drop table test_table
    Neither the word "By Default" is a confusing word nor it happens only in WIZARD. Let me clarify below. I said "When a primary key constraint is created it creates a unique clustered index by default". Run the below DDL and check whether
    a clustered index is created or not. i.e
    CREATE TABLE Persons
    P_Id int NOT NULL,
    LastName varchar(255) NOT NULL,
    FirstName varchar(255),
    Address varchar(255),
    City varchar(255),
    CONSTRAINT pk_PersonID PRIMARY KEY (P_Id,LastName)
    Regards, RSingh
    That did not really make any sense to my context as I am NOT against that it will create Clustered index, In fact, my code says the same. My point is only "By default" is confusing. 
    Let me explain, what I mean "By default"....
    Create index IX_Indexname on Tablename(Colname)
    The above will create "non clustered index" BY DEFAULT. Any situation, the above would create only non-clustered irrespective of other indexes present in the table.
    Hope the above is clear. May be its my way looking at "BY DEFAULT".

  • Transaction replication blocking

    Hello,
    I am seeing that transaction replication inserts are causing a lot of blocking in the subscriber database. The blocked statements are select statements. Does Transaction replication lock tables when it inserts?Can this blocking be prevented?
    Thanks

    Best way to handle this is either decrease the commitbatchsize and commitbatchsizethresholds on the distribution agent profile, or the use the snapshot isolation level (READ_COMMITTED_SNAPSHOT)
    on your subscriber database.
    You might want to also change the fill factor on the problem tables, examine the indexes there to see if they are used, and then examine the blocking workload to see if there is anything you can do to reduce its impact. Indexing may help.
    Replication may cause blocking, especially if more than 5000 rows are being inserted in a batch. Disabling lock escalation will help here - if table level locks are being held. Disabling lock escalation is not always a good thing to do - you will need to
    carefully examine locking/blocking to determine what your best approach is.
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • Retrieve and update dynamic data

    Dear
    Please advise if ECM provides the ability to retrieve and update dynamic data on demand to ensure the user’s content is current
    Thanks
    M.E.
    Edited by: user803214 on Jan 31, 2011 5:34 AM

    The Question is quite vague. Very hard to answer a question when you do not know what they are asking.
    As to automatic indexing and updates of data to files and the impact of indexing:
    A file checked into UCM server is indexed based upon the system setting. A server could be set to DATABASE.METADATA indexing or some kind of full text indexing. Either way if a file is checked into the Content Server the file gets indexed. If any metadata is changed by a later update the index is indeed updated automatically. If the file in a full text indexed system has a set of text edited or a totally different file is checked in the index is updated automatically also.

  • Help needed in index creation and its impact on insertion of records

    Hi All,
    I have a situation like this, and the process involves 4 tables.
    Among the 4 tables, 2 tables have around 30 columns each, and the other 2 has 15 columns each.
    This process contains validation and insert procedure.
    I have already created some 8 index for one table, and an average of around 3 index on other tables.
    Now the situation is like, i have a select statement in validation procedure, which involves select statement based on all the 4 tables.
    When i try to run that select statement, it takes around 30 secs, and when checked for plan, it takes around 21k memory.
    Now, i am in a situation to create new index for all the table for the purpose of this select statement.
    The no.of times this select statement executes, is like, for around 1000 times of insert into table, 200 times this select statement gets executed, and the record count of these tables would be around one crore.
    Will the no.of index created in a table impacts insert statement performace, or can we create as many index as we want in a table ? Which is the best practise ?
    Please guide me in this !!!
    Regards,
    Shivakumar A

    Hi,
    index creation will most definitely impact your DML performance because when inserting into the table you'll have to update index entries as well. Typically it's a small overhead that is acceptable in most situations, but the only way to say definitively whether or not it is acceptable to you is by testing. Set up some tests, measure performance of some typical selects, updates and inserts with and without an index, and you will have some data to base your decision on.
    Best regards,
    Nikolay

  • Impact of Logging INDEX on Nologging object(TABLE) at the time of Recoveryt

    Hi All,
    If I have a TABLE which is of NOLOGGING Mode and the index on this table is of LOGGING Mode. If I want to Recover this table in case of its lost. How It will impact? Will it give any Error? Please Explain.....
    Thanks in Advance.

    You could always do this at the time of the backup to ensure no logging objects are recoverable from the backup at that point in time.......
    "alter database force logging "......... this enables the DBA to override no logging to ensure recoverability.

  • Index creation online - performance impact on database

    hi,
    I have oracle 11.1.0.7 database running on Linux as 3 node RAC.
    I have a huge table which has more than 255 columns and is about 400GB in size which is also highly fragmented because of constant DML activities.
    Questions:
    1. For now i am trying to create an index Online while the business applications are running.
    Will there be any performance impact on the database to create index Online on a single column of a table 'TBL' while applications are active against the same table? So basically my question will index creation on a object during DML operations on the same object have performance impact on the database? is there a major performance impact difference in the database in creating index online and not online?
    2. I tried to build an index on a column which has NULL value on this same table 'TBL' which has more than 255 columns and is about 400GB in size highly fragmented and has about 140 million rows.
    I requested the applications to be shutdown, but the index creation with parallel of 4 a least took more than 6 hours to complete.
    We have a Pre-Prod database which has the exported and imported copy of the Prod data. So the pre-Prod is a highly de-fragmented copy of the Prod.
    When i created the same index on the same column with NULL, it only took 15 minutes to complete.
    Not sure why on a highly fragmented copy of Prod it took more than 6 hours compared to highly defragmented copy of Pre-Prod where the index creation took only 15 minutes.
    Any thoughts would be helpful.
    Thanks.
    Phil.

    How are you measuring the "fragmentation" of the table ?
    Is the pre-prod database running single instance or RAC ?
    Did you collect any workload stats (AWR / Statspack) on the pre-prod and production systems while creating (or failing to create) the index ?
    Did you check whether the index creation ended up in-memory, single pass or multi pass in in the two environments ?
    The commonest explanation for this type of difference is two-fold:
    a) the older data needs a lot of delayed block cleanout, which results in a lot of random I/O to the undo tablespace - slowing down I/O generally
    b) the newer end of the table is subject to lots of change, so needs a lot of work relating to read-consistency - which also means I/O on the undo system
      --  UPDATED:  but you did say that you had stopped the application so this bit wouldn't have been relevant.
    On top of this, an online (re)build has to lock the table briefly at the start and end of the build, and in a busy system you can wait a long time for the locks to be acquired - and if the system has been busy while the build has been going on it can take quite a long time to apply the journal file to finish the index build.
    Regards
    Jonathan Lewis

  • Impact of creating a non-clusterd index on a huge transaction table?

    Hello Everyone,
    We have a transaction table containing 10 million records and everyday a million records will be inserted. We don’t have any clustered index on this table as this is a transaction table (more than 10 columns to uniquely identify a row). We
    do have some SPs which in turn some reports getting generated using this table. In order to improve the performance of an SP, we created a non-clustered index on this table and we found a huge performance gain.
      Here comes my question - will this (creation of non-clustered index) impacts my table data load performance or other reports generation?
    Any suggestions will be appreciated.
    Many Thanks!
    Rajasekhar.

    Hello Rajasekhar, 
    First identify this table and corresponding columns usage. Through SP_depends system procedure you can identify this table dependencies. 
    Then look at complex queries and it's execution plans. You can get an output recommendations of appropriate missing indexes. 
    Now you can try to create appropriate indexes. Always I suggest you to limit the index count if you are inserting/updating large volume records. Also if possible create clustered index. 
    One more option, you can horizontally partitioned the table and move data to multiple filegroups. Based of range of data your query performance also improve a lot. 
    To apply partition for existing table, you should take backup and recreate from scartch. 
    Check this link : http://www.mssqltips.com/sqlservertip/2888/how-to-partition-an-existing-sql-server-table/
    Best Regards, 
    Ashokkumar.
    Ashokkumar

  • Impact of Creating new index ?

    Hi All, I am using 10.2.0.4.0 version of oracle.
    I want expert advice in below scenario.
    I need to create one index, as because a particular 'Search' query going slow and my customer frequently accessing that 'Search' Functionality. i have tried all alternative for tuning that query, and finally decided to go for creating New Composite index on two columns of a table that is used in the query.
    So my question/concern is , what will be the impact on other 'Select' queries those are using these columns in their predicate? Whether there is any possibility of any negative impact(slow performance) on them due to this new index. What should be the right way to go for impact analysis in the above scenario?
    ( Please note in this case i am least bothered about the impact on 'INSERTS' due to this index creation).

    >
    Hi again,
    For now, can you please confirm, As 'rp0428' mentioned there is chances of better performance in other 'Select' queries,
    but there is no chance of performance degradation to this new index in other queries. As because oracle will evaluate the best among all.
    Is the above statement always hold true or there may be deviations?Hmmm... I can see no good reason why an added index should adversely affect other SELECTs - the optimiser should
    simply ignore the new index if it doesn't impact other queries - and may make use of it in ways you didn't forsee.
    Having said that, I can't guarantee that this is the case. I would run tests before implementing it in production - at least
    try and test your most common/frequently run queries - remember [url http://en.wikipedia.org/wiki/Pareto_principle]Paretos law.
    A small fraction of your queries will have a large impact on the system and some will be "marginal" to performance/usage.
    Sometimes the optimiser behaves in counter-intuitive ways - run at least some tests and then try it is what I would do if you
    (can't | don't have the time to) test exhaustively.
    HTH,
    Paul...

Maybe you are looking for