Can I index a RowVersion column

Hi
In order to track changes in tables I was going to add a RowVersion to each affected table. Then at a certain point in time take the max rowversion used in the table and store it. Some time in the future I can then query a table and find all the rows that
have change since my last check.
In order to make this perform well, I was  going to add indexes to these tables based on the RowVersion column. Would this be a bad idea as this column is frequently changing?
Thanks for your help
Graham

Why do you need to use rowversion for this? Why not set
a datetime field like datemodified for this? That will have much more clarity and you would still be able to get
incremental details from it. rowversion is used mostly during
concurrent DML operations to see if copy we had on hand is latest copy of record or does an update has happen since then.
Indexing it in any case would be bad as any changes in any of data in table (or even false update) can cause it to change its value which would cause index to be frequently updated.
Please Mark This As
Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • How to define the Index on the column which is define in view (9i)

    hi all,
    I have one view which is based on to tables say 'customers' and 'vendors'
    view definition is like:
    create or replace view customer_vendor as
    select customer_name, 'Customer' type from customers
    union all
    select vendor_name, 'Vendor' type form vendors;
    my problem is that how i can define index on 'type' column if i used in where clause when i query the view.
    Regards
    s

    An index is a pointer. A pointer to a data place.
    Data result of a view aren't stored.
    So, how an index may work against a view ?
    SQL> create index idx1 on v1(type);
    create index idx1 on v1(type)
    ERROR at line 1:
    ORA-01702: a view is not appropriate hereThink about mview instead of view, maybe that can help. Data result of mview are stored somewhere in database, so you are allowed to create an index against mview, like for table.
    Anyway, if you want 'Customer', why not request onto customers table ?
    Nicolas.

  • Can Verity/Solr index files AND columns from db into one resultset?

    Hi,
    I have a form where users upload a document and also add some meta data that goes with the document.  I currently store the meta data in the db and the actual document on the file system.
    How can I use Verity/Solr to index files and columns from a database table so it will return one recordset?
    -ws

    <cfindex type="file"> should do the trick, shouldn't it?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d 04.html
    Adam

  • Multi-column Index vs One index for each column

    Hello everyone,
    i have one table about 20 000 000 rows, some developers have to generate reports on it and i want to create indexes on this table.
    The table has 34 columns, no primary key, no unique keys.
    The "where..." clause of the reports usually use 8 columns but some reports uses 8 + some other columns.
    can any one help me on what kind of indexes do i have to create?
    1. one index for each column used in "where clause"
    2. one index for 8 columns and some other indexes for other used columns
    3. one index for all columns
    or something else etc...
    br flag

    i have one table about 20 000 000 rows, some developers have to generate reports on it and i want to create indexes on this table.
    The table has 34 columns, no primary key, no unique keys.
    The "where..." clause of the reports usually use 8 columns but some reports uses 8 + some other columns.
    can any one help me on what kind of indexes do i have to create?
    1. one index for each column used in "where clause"
    2. one index for 8 columns and some other indexes for other used columns
    3. one index for all columns
    or something else etc...What's the version of your data base? what kind of database you have, DWH or OTLP? The answer might depend on the type of database as far as bitmap indexes might suit or might not depending if you are runing DWH or OLTP kind of database
    Let me suppose that you are runing OLTP database and you have a where clause with 8 columns.
    1) are all those where clause equalities (where col1 = and col2 =) or there are inequalities?
    2) could you evaluate the most repetitive columns?
    3) could you know the column that could have the best clustering factor (the column which most follow a certain order in the table)
    Based on that I would suggest to create one b-tree index having 8 columns (even though that it seems for me to high) this index should follow the following points:
    1) put the most repetitive column at the leading edge (and compress the index if necessary)
    2) put the columns that are used in equalitity predicate first
    3) put the column having the best clustering factor first
    The most precise index you have the best access you could gain.
    Of course that you have to know that an index access is not always good and a FULL table scan is not always bad.
    Best regards
    Mohamed Houri
    www.hourim.wordpress.com

  • How can I add a new column in compress partition table.

    I have a compress partition table when I add a new column in that table it give me an error "ORA-22856: CANNOT ADD COLUMNS TO OBJECT TABLES". I had cretaed a table in this clause. How can I add a new column in compress partition table.
    CREATE TABLE Employee
    Empno Number,
    Tr_Date Date
    COMPRESS PARTITION BY RANGE (Tr_Date)
    PARTITION FIRST Values LESS THAN (To_Date('01-JUL-2006','DD-MON-YYYY')),
    PARTITION JUNK Values LESS THAN (MAXVALUE));
    Note :
    When I create table with this clause it will allow me to add a column.
    CREATE TABLE Employee
    Empno Number,
    Tr_Date Date
    PARTITION BY RANGE (Tr_Date)
    PARTITION FIRST Values LESS THAN (To_Date('01-JUL-2006','DD-MON-YYYY')),
    PARTITION JUNK Values LESS THAN (MAXVALUE));
    But for this I have to drop and recreate the table and I dont want this becaue my table is in online state i cannot take a risk. Please give me best solution.

    Hi Fahed,
    I guess, you are using Oracle 9i Database Release 9.2.0.2 and the Table which you need to alter is in OLTP environment where data is usually inserted using regular inserts. As a result, these tables generally do not get much benefit from using table compression. Table compression works best on read-only tables that are loaded once but read many times. Tables used in data warehousing applications, for example, are great candidates for table compression.
    Reference : http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_data.html
    Topic : When to Use Table Compression
    Bug
    Reference : http://dba.ipbhost.com/lofiversion/index.php/t147.html
    BUG:<2421054>
    Affects: RDBMS (9-A0)
    NB: FIXED
    Abstract: ENH: Allow ALTER TABLE to ADD/DROP columns for tables using COMPRESS feature
    Details:
    This is an enhancement to allow "ALTER TABLE" to ADD/DROP
    columns for tables using the COMPRESS feature.
    In 9i errors are reported for ADD/DROP but the text may
    be misleading:
    eg:
    ADD column fails with "ORA-22856: cannot add columns to object tables"
    DROP column fails with "ORA-12996: cannot drop system-generated virtual column"
    Note that a table which was previously marked as compress which has
    now been altered to NOCOMPRESS also signals such errors as the
    underlying table could still contain COMPRESS format datablocks.
    As of 10i ADD/SET UNUSED is allowed provided the ADD has no default value.
    Best Regards,
    Muhammad Waseem Haroon
    [email protected]

  • How to create  index for a column of a view

    Hi,
    I have created view for a table and then i am trying to create index for a column of that view. i am using the query "CREATE INDEX index_name ON view_name (col)". but Mysql is showing error like "view_name is not a base table".
    How can i do that......

    As mentioned this is a java forum not a mysql forum, but as I know the answer - you can't create an index directly on a view in mysql.

  • More than one index for a column.

    Hi,
    I am trying to create more than one index for a particular column of the table.But oracle does not allow more than one index for a column.
    I just want to make sure whether we can add more than one index for a column
    and if yes what are the scenarios.
    Because as far as i know some database allows more than one index for a single column.

    You cannot create more than one index for the same column(s).This is not so true Nicolas. Look at following example:
    SQL> create index idx_mytest_id on mytest(id);
    Index created.
    SQL> create index idx_mytest_id_desc on mytest(id desc);
    Index created.
    SQL> create index idx_fbi_mytest_id_upper on mytest(upper(id));
    Index created.
    SQL> create index idx_fbi_mytest_id_upper_desc on mytest(upper(id) desc);
    Index created.
    SQL> create index idx_fbi_mytest_id_lower_id on mytest(lower(id));
    Index created.
    SQL> create index idx_fbi_mytest_id_lower_id_dsc on mytest(lower(id) desc);
    Index created.
    SQL> create index idx_fbi_mytest_id_tr_up on mytest(trunc(upper(id)));
    Index created.
    -- I can still continue but for this example this will be enough
    SQL> select index_name from dba_indexes where table_name = 'MYTEST';
    INDEX_NAME                                                                                                    
    IDX_MYTEST_ID                                                                                                 
    IDX_FBI_MYTEST_ID_UPPER                                                                                       
    IDX_MYTEST_ID_DESC                                                                                            
    IDX_FBI_MYTEST_ID_UPPER_DESC                                                                                  
    IDX_FBI_MYTEST_ID_LOWER_ID                                                                                    
    IDX_FBI_MYTEST_ID_LOWER_ID_DSC                                                                                
    IDX_FBI_MYTEST_ID_TR_UP                                                                                       
    7 rows selected.You can see 7 indexes for one column (ID) and I could still continue...
    So according this test we can say you can't create more than one index for one column (or the same group of columns in case of composite index) with same condition(s).
    Message was edited by:
    Ivan Kartik
    Or simplified: you can't create the same index for same column(s) twice :-)

  • Is there a way to find out how to get the index of a column?

    Hello,
    I want to know the index of a column for example the column at the first position in a jtable is 0 so how can i get this index?
    for example: the column called "surname" is index 0 but the user can move the column. So the name stays the same but the index of the column changed. I search for a method like
    table.getColumnIndex("surname");

    I think it really depends on what the OP is trying to do. I think the program
    below offers up the possible choices pretty well.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableColumnIndexDemo extends JFrame {
         private JTable table;
         private String[] names = new String[]{ "One", "Two", "Three", "Four", "Five" };
         public static void main( String args[] ) {
              SwingUtilities.invokeLater( new Runnable() {
                   public void run() { new TableColumnIndexDemo(); }
         public TableColumnIndexDemo() {
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              DefaultTableModel model = new DefaultTableModel( names, 1 );
              table = new JTable( model );
              JButton button = new JButton( "Print indices" );
              button.addActionListener( new ActionListener() {
                   public void actionPerformed( ActionEvent e ) {
                        printIndices();
              getContentPane().setLayout( new BorderLayout() );
              getContentPane().add( button, BorderLayout.NORTH );
              getContentPane().add( new JScrollPane( table ), BorderLayout.CENTER );
              getContentPane().add( new JLabel( "Move columns around then print indices" ), BorderLayout.SOUTH );
              setSize( 300, 150 );
              setVisible( true );
              printIndices();
         private void printIndices() {
              TableColumnModel columnModel = table.getColumnModel();
              TableModel model = table.getModel();
              StringBuffer sb = new StringBuffer();
              System.out.println( "Visible order");
              for ( int k = 0; k < columnModel.getColumnCount(); k++ ) {
                   if ( k > 0 ) sb.append( ", " );
                   sb.append( k ).append( " " ).append( columnModel.getColumn( k ).getIdentifier() );
              System.out.println( sb );
              sb = new StringBuffer();
              System.out.println( "By name using getColumnIndex(TableModel,name)" );
              for( int k = 0; k < names.length; k++) {
                   if ( k > 0 ) sb.append( ", " );
                   sb.append( getColumnIndex( model, names[k] ) ).append( " " ).append( names[k] );
              System.out.println( sb );
              sb = new StringBuffer();
              System.out.println( "By name using columnModel.getColumnIndex(name)" );
              for( int k = 0; k < names.length; k++) {
                   if ( k > 0 ) sb.append( ", " );
                   sb.append( columnModel.getColumnIndex( names[k] ) ).append( " " ).append( names[k] );
              System.out.println( sb );
              sb = new StringBuffer();
              System.out.println( "Model index by visible order");
              for ( int k = 0; k < columnModel.getColumnCount(); k++ ) {
                   if ( k > 0 ) sb.append( ", " );
                   TableColumn column = columnModel.getColumn( k );
                   sb.append( column.getModelIndex() ).append( " " ).append( column.getIdentifier() );
              System.out.println( sb );
         public static int getColumnIndex(TableModel model, String name) {
             for(int i = 0; i < model.getColumnCount(); i++) {
                 if( model.getColumnName(i).equalsIgnoreCase(name) ) {
                     return i;
             return -1;
    }

  • How to get the index of a Column

    Hello,
    I want to know the index of a column for example the column at the first position in a jtable is 0 so how can i get this index?
    for example: the column called "surname" is index 0 but the user can move the column. So the name stays the same but the index of the column changed. I search for a method like
    table.getColumnIndex("surname");

    So why do you post questions on multiple forums.
    Like I said you are wasting peoples time. We don't know what has been suggested on the other forums. So by answering the question here we are wasting our time because you also probably got the answer on the other forum as well.

  • How can i select the next column instead of next row when press enter key

    I need to know how can i select the next column instead of next row when i press the enter key.By default ,when i press enter key the next row is selected and the column remain unchanged but I wants opposite that is the row should remain unchanged but column index will changed.
    Thanks to all.

    Well, the right arrow key will already move you to the next column, so the easiest way to do this is to modify the InputMap to have the Enter key invoke the same Action as the right arrow key.
    You can search the forum for my "Table Actions" (without the space) example that will show you how to do this.

  • CREATE INDEX WITH DUPLICATE COLUMN NAME

    Hi,
    i need to interface our application with an Orale Bridge to CREATE INDEX with duplcate column Name.
    For Example
    CREATE index NLOT_FOURNLOT_idx ON NLOT(FOURNISSEUR ,NOLOT ,FOURNISSEUR ,NOBLFOUNISSEUR,NOLIGNEBL ,NOLOT ,QTECOLISRECUES ,CODENONQUALITE ,QTECOLISACCEPTE);
    CREATE table NLOT(
    FOURNISSEUR VARCHAR2(09)
    ,NOBLFOURNISSEUR VARCHAR2(13)
    ,NOLIGNEBL VARCHAR2(03)
    ,NOLOT VARCHAR2(20)
    ,QTECOLISRECUES VARCHAR2(10)
    ,CODENONQUALITE VARCHAR2(02)
    ,QTECOLISACCEPTE VARCHAR2(10)
    ,NOMBREDECOLISRE VARCHAR2(10)
    ,NOMBREDECOLISAC VARCHAR2(10)
    ,FILLER VARCHAR2(1)
    ,FILLE1 VARCHAR2(1)
    ,TYPEREFERENCE VARCHAR2(01)
    ,REFERENC1 VARCHAR2(15)
    ,CONTROLERECEPTI VARCHAR2(01)
    ,DATEDEPEREMPTIO VARCHAR2(8)
    ,CONTROLEPROCHAI VARCHAR2(1)
    Thanks
    Philippe

    Well, you can't do it. ORA-957 is one of those irrevocable errors for which the solution is to remove the duplicate name from the SQL statement.
    But, anyway, why do you want to do this? I would guess there's no performance benefit from having the same column indexed twice (of course it's impossible to test this, so it's just my opinion).
    Cheers, APC

  • I can't add any more columns. The option is suddenly greyed out.

    I can't add any more columns. The option is suddenly greyed out.

    Allen,
    Actually, there is a TRANSPOSE Function, but no Command or Tool for that. It's one of the more useful and popular omissions in Numbers. Perhaps because it falls into the "didn't plan ahead so now I need a tool" category of features, it didn't make the cut.
    Use of the Transpose Function is described in the Function Browser, the Help feature and in the Functions of Formulas User Guide PDF. It involves using the INDEX function to read out the array created by the Transpose function. Another way to do this is to use the OFFSET function in an expression and by exchanging the row and column references.
    Yvan Koenig has written an Applescript that will automate the transposition for data and for certain simple expressions. You can get it from his Box Account, on this page.
    Jerry

  • Index on multiple columns issue Oracle 9i

    Hi,
    I have a couple of issues and would appreciate it if anyone can help:
    a). I have a table that has indexes on multiple columns, so for example:
    Index 1 on Org_Type, Org_Id and Effdt
    Index 2 on FICE_CD, Org_Id and Effdt etc.
    I have 9 such indexes and all of them hav Effdt in it.
    My question is if I query the table and always use a subquery to get the max Effdt rows form the table, will the above indexes help in my query or will I have to create another index just on Effdt so that my Query runs faster.
    b). I have a target table with more than 20 million rows in it. This table has an Effdt too and I would like to find the max effdted row in this table as well so that I can then use that date-time stamp in my ETL tool to do an incremental update from my source table each night. But since the amount of rows is huge, my query runs forever. I have a normal non-unique index on Effdt. Is there another way I can optimize this table? Currenlty I have resorted to getting all rows from source that are >= (sysdate -1), but I would prefer to get the max date-time stamp from the target table itself.
    Thanks,
    CJ

    Hi ,
    Thanks for the input. I just used the explain plan and found that there is a full table scan happening on the PS_EXT_ORG_TBL, so I guess I will have to create an index specifically on the effdt field. The sql is as follows:
    Select E.EMPLID, E.INSTITUTION, E.EXT_ORG_ID, E.EXT_CAREER, E.EXT_DATA_NBR, E.EXT_SUMM_TYPE, E.UNT_ATMP_TOTAL, E.UNT_COMP_TOTAL,
    E.CLASS_RANK, E.CLASS_SIZE, E.PERCENTILE, E.UM_GPA_EXCLUDE, E.UM_EXT_ORG_GPA, E.CONVERT_GPA,
    E.UM_EXT_ORG_CNV_CR, E.UM_EXT_ORG_CNV_GPA, E.UM_EXT_ORG_CNV_QP, E.UM_GPA_OVERRIDE, E.EXT_ACAD_LEVEL,
    F.FROM_DT, F.TO_DT, G.EXT_DEGREE_NBR, G.DEGREE, G.DESCR "DEGREE DESCR", G.DEGREE_DT, H.EFFDT,
    H.EFF_STATUS, H.SCHOOL_CODE, H.LS_SCHOOL_TYPE, H.ATP_CD, H.CITY, H.STATE, H.COUNTRY,
    H.DESCR "SCHOOL DESCR", H.PROPRIETORSHIP
    FROM PS_EXT_ACAD_SUM E, PS_EXT_ACAD_DATA F, PS_EXT_DEGREE G, PS_EXT_ORG_TBL H
    WHERE E.EXT_ORG_ID = F.EXT_ORG_ID AND E.EMPLID = F.EMPLID
    AND E.EXT_ORG_ID = G.EXT_ORG_ID AND E.EMPLID = G.EMPLID
    AND E.EXT_ORG_ID = H.EXT_ORG_ID
    AND H.EFFDT=(SELECT MAX(EFFDT) FROM PS_EXT_ORG_TBL H1
              WHERE H.EXT_ORG_ID=H1.EXT_ORG_ID
                        AND H.EFF_STATUS=H1.EFF_STATUS
                        AND H.SCHOOL_CODE=H1.SCHOOL_CODE
                        AND H.LS_SCHOOL_TYPE=H1.LS_SCHOOL_TYPE
                        AND H.ATP_CD=H1.ATP_CD
                        AND H.CITY=H1.CITY
                        AND H.STATE=H1.STATE )
    My source DB is a copy of the transactional database, so there is no danger of new rows coming in.

  • How to create index on xmltype column

    I have a table having only one column xmlcontent (xmltype). This table stores xml data of about 10GB size. I'm using extract value to move the data to staging tables.
    How can I create index on xmltype column?
    Create index indexname on table (column) doesn't seem to work.
    Sample xmlstructure is given below
    <Root>
    <Type>Insert</Type>
    <Date>2006-12-29</Date>
    <Source>8</Source>
    <id>data</id>
    <key_flds>
    <fld><id>Key1</id><val>C</val></fld>
    <fld><id>Key2</id><val>429672</val></fld>
    <fld><id>Key3</id><val>8</val></fld>
    </key_flds>
    </Root>
    I need to do extract value on all tags and move them to corresponding relational tables.

    Hi, you need to create them using something like this (what I have used and work rather well - if I did not load the xml into an xml table, the processing took about 10 minutes, while the indexed xml table took just a few seconds). statute_xml is the table name and sxmldoc is the xml column/field.
    create index desc_idx on statute_xml
    (sxmldoc.existsNode('/SimpleTypeCompanion/EnumerationValue/@description'))
    create index sid_idx on statute_xml
    (sxmldoc.existsNode
    ('/SimpleTypeCompanion/EnumerationValue/Text')
    create index effdate_idx on statute_xml
    (sxmldoc.existsNode
    ('/SimpleTypeCompanion/EnumerationValue/@effectiveDate')
    Hope this helps.
    Ben

  • How to create a index on a column with type clob

    how to create a index on a column with type clob

    You should have a look to Oracle Text to check if Oracle Text indexing features can meet your needs:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16508/cncptdev.htm#CNCPT1537

Maybe you are looking for

  • Parsing an XML file

    I've written a program which is partly responsible for parsing an XML file that can be found on the web. I appear to be accessing the XML file correctly, but when I try to parse it I am running into a problem. I try to create a List object that conta

  • Oracle10g

    Hello, I have oracle 9i installed on windows XP(prof). Do I have to uninstall 9i before installing Oracle Database 10g Standard Edition One? Please advice. Thank you, Eric.

  • "To open this iPhoto library in Aperture, it first needs to be upgraded".  Aperture already up to date. still cant open aperture library. please advice

    When I try to open my aperture library, this is the message pop out  " TO OPEN THIS iPHOTO LIBRARY IN APERTURE, IT FIRST NEEDS TO BE UPGRADED. " My apperture application is already up to date. no more upgrade available. please advice what to do.

  • Dodge/Burn Tool

    Hi. Just been playing with PSE8 and having problems with the dodge/burn tool. Know it's usually located with the sponge tool but for some reason I can't access them. The sponge tool is visible in the tool box but when highlighted, the options at the

  • Drag and drop images in Dreamweaver

    I've been meaning to ask this for a while. Cannot drag images into live view in Dreamweaver Cs6. Windows 7. Sometimes it works, sometimes it doesn't. This happens randomly on all three machines. What's causing this. This is one of those that you see