What is database re indexing

hi
what  is database re indexing
what is the concept of it,
adil

One can REBUILD or REORGANIZE an existing index.  
BOL: "This topic describes how to reorganize or rebuild a fragmented index in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL. The SQL Server Database Engine automatically maintains indexes whenever insert, update, or delete operations
are made to the underlying data. Over time these modifications can cause the information in the index to become scattered in the database (fragmented). Fragmentation exists when indexes have pages in which the logical ordering, based on the key value, does
not match the physical ordering inside the data file. Heavily fragmented indexes can degrade query performance and cause your application to respond slowly.
You can remedy index fragmentation by reorganizing or rebuilding an index. For partitioned indexes built on a partition scheme, you can use either of these methods on a complete index or a single partition of an index. Rebuilding an index drops and re-creates
the index. This removes fragmentation, reclaims disk space by compacting the pages based on the specified or existing fill factor setting, and reorders the index rows in contiguous pages. When ALL is specified, all indexes on the table are dropped and rebuilt
in a single transaction. Reorganizing an index uses minimal system resources. It defragments the leaf level of clustered and nonclustered indexes on tables and views by physically reordering the leaf-level pages to match the logical, left to right, order of
the leaf nodes. Reorganizing also compacts the index pages. Compaction is based on the existing fill factor value."
LINK: http://technet.microsoft.com/en-us/library/ms189858.aspx
The following blog demonstrates how to REBUILD all the indexes in a database:
http://www.sqlusa.com/bestpractices2008/rebuild-all-indexes/
Kalman Toth Database & OLAP Architect
SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Similar Messages

  • Last week what are the new indexes created in my database

    last week what are the new indexes created in my database.How can I know?
    Thanks

    Please try this:
    SELECT t.name AS TableName ,
    ind.name AS IndexName ,
    col.name AS ColumnName ,
    STATS_DATE(t.object_id, ind.index_id) AS IndexCreationDate
    FROM sys.indexes ind
    INNER JOIN sys.index_columns ic ON ind.object_id = ic.object_id
    AND ind.index_id = ic.index_id
    INNER JOIN sys.columns col ON ic.object_id = col.object_id
    AND ic.column_id = col.column_id
    INNER JOIN sys.tables t ON ind.object_id = t.object_id
    WHERE ind.is_primary_key = 0
    AND ind.is_unique = 0
    AND ind.is_unique_constraint = 0
    AND t.is_ms_shipped = 0
    AND STATS_DATE(t.object_id, ind.index_id) > ( GETDATE() - 7 ) ;
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • WHat is the best index type for non uniqueness / Varchar columns in SQL 2008 R2

    Hello All Greetings,
    Please help me here with my doubt,
    in my table i have two columns about a million rows, it has about 20 columns in it, three columns with name as Period, Gender so most of the time these two columns use in where clause,
    Gender  will contain Either M or F , Period contains YYYY-Month (2013-December, 2013-August) etc so i would like to add a Index to these two columns so that in will increase the performance, so please let me know what type of indexes i need to add to
    these columns in the table,
    please note that only one time we will add data to the table which will take only 2 minutes but we query the table every day
    so my question what is the best index type that i need to create on columns with non uniqueness values in the column.,
    Thank you In Advance,
    Milan

    There is nothing whatever wrong with creating an index on a VARCHAR column, or set of columns.
    Regarding the performance of VARCHAR/INT, as with everything in a RDBMS, it depends on what you are doing. What you may be thinking of is the fact that clustering a table on a VARCHAR key is (in SQL Server) marginally less efficient than clustering on a monotonically
    increasing numerical key, and can introduce fragmentation.
    Or you may be thinking of what you have heard about writing JOINs on VARCHAR columns - it is true, it is a little less efficient than a JOIN on numeric type, but it is only a little less efficient, nothing that would lead you to never join on varchar cols.
    None of this does not mean that you should not create indexes on VARCHAR columns. A needed index on a VARCHAR column will boost query performance, often by orders of magnitude. If you need an index on a VARCHAR, create it. It makes no sense to try to find an
    integer column to create the index on - the engine will never use it.
    Check this reference: http://stackoverflow.com/questions/14041481/is-it-good-to-create-a-nonclustered-index-on-a-column-of-type-varchar
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • What is use of index by binaary_integer

    Hi All,
    I have created to program of collection where we use index by binaary_integer in one program and not use index by binaary_integer in second program, but result is same, any body help me what is use of index by binaary_integer here
    1- Declare
    Type emp_table_type is table of
    emp%rowtype index by binary_integer;
    my_emp_table emp_table_type;
    Begin
    select * bulk collect into my_emp_table from emp;
    for i in my_emp_table.first..my_emp_table.last
    loop
    dbms_output.put_line(my_emp_table(i).ename);
    end loop;
    end;
    2- Declare
    Type emp_table_type is table of
    emp%rowtype;
    my_emp_table emp_table_type;
    Begin
    select * bulk collect into my_emp_table from emp;
    for i in my_emp_table.first..my_emp_table.last
    loop
    dbms_output.put_line(my_emp_table(i).ename);
    end loop;
    end;
    your suggestion would be greatly appreciated.

    here is one for you.
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/composites.htm#CHDEIDIC

  • RE: What's database field are used in crystal report file?

    Hi all
    Please help me a C# code that using Crystall Report API (Crystal Report XI- Develop license) to get the list of database fieldname that using in crystal Report file. (What's database field using in header section ,group section , detail section of report.....)
    We looking forward to hearing from you
    Thanks
    Son

    Hello Son,
    please use this code below to get a list of used database fields in a report :
    //File Name:          CS_Get_report_data_out_inproc.sln
    //Created:            April 11, 2008
    //Author ID:          FLI
    //Purpose:            This C# .NET sample Windows application demonstrates
    //                  how to retrieve report data and put the into a XML file
    //                  using unmanaged RAS.
    // Note this is available without a dedicated RAS with SP2 for XI R2
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Get_report_data_out_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    ReportData.rpt");
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                // Retrieve the Rowset Controller
                RowsetController boRowsetController = boReportClientDocument.RowsetController;
                // Retrieve the metadata (column headers) - this allows you to only retrieve the data that is on the report.
                RowsetMetaData boRowsetMetaData = new RowsetMetaData();
                Fields boFields = boReportClientDocument.DataDefinition.ResultFields;
                boRowsetMetaData.DataFields = boFields;
                // Now print out the data in XML file
                //(Note: This will print out the results of formulas too)
                StreamWriter sw = new StreamWriter("C:
    ReportData.xml", false);
                sw.WriteLine("<?xml version='1.0' encoding='utf-8'?>");
                sw.WriteLine("<ReportData>");
                sw.WriteLine("<Reportheader>");
                // Print out the titles
                for (int i = 0; i < boFields.Count; i++)
                    String boFieldName = boFields<i>.Name;
                    sw.WriteLine("<ReportheaderDetail>" + boFieldName + "</ReportheaderDetail>");
                sw.WriteLine("</Reportheader>");
                //Create the cursor which lets us loop through the data
                RowsetCursor boRowsetCursor = boRowsetController.CreateCursor(null, boRowsetMetaData, 1);
                Record boRecord;
                while (boRowsetCursor.IsEOF == false)
                    sw.WriteLine("<Customer>");
                    boRecord = boRowsetCursor.CurrentRecord;
                    for (int j = 0; j < boFields.Count; j++)
                        try
                            sw.WriteLine("<Detail>" + (String)boRecord[j].ToString() + "</Detail>");
                        catch (Exception err)
                            sw.WriteLine("<Error>" + err.Message + "</Error>");
                    sw.WriteLine("</Customer>");
                    boRowsetCursor.MoveNext();
                sw.WriteLine("</ReportData>");
                // CLose the file
                sw.Close();
                MessageBox.Show("XML File 'ReportData.xml' successfully created on C:");

  • Can we change the fields of database unique index in a customised table?

    Hi all..
    I want to know that can we create or change or delete the database unique index of a customized table?
    In my case, there is a customised table with 4 primary keys with all the records to be maintained thru transaction code SM30.
    There is database unique index maintained for this table which has 2 fields. These 2 fields are out of the 4 primary fields of the table.I hope I have made myself clear!
    Now when I am trying to insert a record in the table it give me a short dump.( It says duplication of records is not allowed)
    The reason being that the new record that I am trying to insert in the database table has those 2 fields for which the unique index is maintained is the same as an already existing record.And the other two fields are different from the already existing record.So overall the combination of the 4 primary fields is different.
    Please tell me how shall I proceed now?
    I also tried to change the Unique index but it is asking me some kind of authrization(You are not authorized to make changes (authorization object S_DEVELOP)).Also I am not sure whether changing the unique index is feasible or not.?
    Thanks.

    hi
    I think you will not be able to do unique indexing withou the help of primary keys,so use all the primary keys into the table field selections  and and then create indexing otherwise dupilication of keys can occur. if you are not able to keep the primary keys then go for non unique key indexing,where you have to add the client field and the any keys of your wish.

  • What is Database clone? what are the ways in MS SQL Server?

    No ,I am looking for Database cloning. Is there any feature in sqlserver like this.
    Bz someone ask me that What is Database cloning in Sqlserver.

    No ,I am looking for Database cloning. Is there any feature in sqlserver like this.
    Bz someone ask me that What is Database cloning in Sqlserver.
    No there is no feature exactly to clone a database.Or a command or GUI for *cloning* specifically.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • What is "database.sqlite3"? It's keeping me from deleting my trash.

    What is "database.sqlite3"? It's keeping me from empting my trash can.

    Hello:
    I have no clue how you got that on your computer - it is not installed by OS X.
    http://www.fileinfo.com/extension/sqlite3
    In any event, try emptying the trash while holding the option key down.
    I use a little utility called "Cocktail" for really tough trash problems (be careful if you use Cocktail, it has very powerful capabilities).
    Barry

  • DATABASE.FULLTEXT indexer stuck on Delete

    I've run into an issue with our Database Fulltext Indexer on UCM 10g. The Automatic Update Cycle seems to be 'stuck' on Deleting metadata for a piece of content that is no longer in the system. The indexer State is "Clean Up" and the Status is Active. The message says "Deleting metadata (0 of 1)". I've run IdcAnalyze on the collection looking for possible errors but it did not report any problems.
    Is there some place I can clear this Indexer state and start processing new content items that are backing up? I'd like to be able to avoid a collection rebuild if at all possible.

    Srinath - the two things that stick out in my mind are these two items, one from the Server Logs and the other from Output after turning on indexer and system database..
    Looks like this query reached max time out and canceled.
    ------from Server Logs---------
    Unable to do clean up. csDbUnableToExecuteBatch() error occurred during batching: ORA-01013: user requested cancel of current operation
    java.sql.BatchUpdateException: error occurred during batching: ORA-01013: user requested cancel of current operation [ Details ]
    An error has occurred. The stack trace below shows more information.
    !csIndexerAbortedMsg!csIndexerUnableToCleanup!csDbUnableToExecuteBatch,!$error occurred during batching: ORA-01013: user requested cancel of current operation<br>!syExceptionType2,java.sql.BatchUpdateException,error occurred during batching: ORA-01013: user requested cancel of current operation<br>
    intradoc.common.ServiceException: !csIndexerUnableToCleanup
         at intradoc.indexer.Indexer.doCleanUp(Indexer.java:825)
         at intradoc.indexer.Indexer.doWork(Indexer.java:278)
         at intradoc.indexer.Indexer.doIndexing(Indexer.java:439)
         at intradoc.indexer.Indexer.buildIndex(Indexer.java:348)
         at intradoc.server.IndexerMonitor.doIndexing(IndexerMonitor.java:1012)
         at intradoc.server.IndexerMonitor$4.run(IndexerMonitor.java:832)
    Caused by: intradoc.data.DataException: !csDbUnableToExecuteBatch,!$error occurred during batching: ORA-01013: user requested cancel of current operation
         at intradoc.jdbc.JdbcWorkspace.handleSQLException(JdbcWorkspace.java:2371)
         at intradoc.jdbc.JdbcWorkspace.executeBatch(JdbcWorkspace.java:525)
         at intradoc.indexer.IndexerWorkObject.executeDependentQueriesAllowBatch(IndexerWorkObject.java:417)
         at intradoc.indexer.IndexerWorkObject.executeDependentQueriesEx(IndexerWorkObject.java:344)
         at intradoc.indexer.IndexerWorkObject.executeDependentQueries(IndexerWorkObject.java:338)
         at intradoc.indexer.Indexer.cleanUpQueries(Indexer.java:557)
         at intradoc.indexer.Indexer.doCleanUp(Indexer.java:821)
         ... 5 more
    Caused by: java.sql.BatchUpdateException: error occurred during batching: ORA-01013: user requested cancel of current operation
         at oracle.jdbc.driver.OracleStatement.executeBatch(OracleStatement.java:4534)
         at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:213)
         at intradoc.jdbc.JdbcWorkspace.executeBatch(JdbcWorkspace.java:519)
         ... 10 more
    From server output .. the Indexer now says it's in Clean Up mode deleting metadata (0 of 3) and I'm assuming it's these three;
    systemdatabase     01.24 05:48:15.810     index update work     9.40 ms. SELECT/*+ INDEX (Revisions dIndexerState dStatus)*/ dID FROM Revisions
              WHERE dStatus='DELETED' AND dIndexerState = 'A'[Executed. Returned row(s): true]
    systemdatabase     01.24 05:48:15.811     index update work     Batched query added at index 0: DELETE/*+ INDEX (DocMeta PK_DocMeta)*/ FROM DocMeta
              WHERE DocMeta.dID = 485759
    systemdatabase     01.24 05:48:15.813     index update work     Batched query added at index 1: DELETE/*+ INDEX (DocMeta PK_DocMeta)*/ FROM DocMeta
              WHERE DocMeta.dID = 485760
    systemdatabase     01.24 05:48:15.813     index update work     Batched query added at index 2: DELETE/*+ INDEX (DocMeta PK_DocMeta)*/ FROM DocMeta
              WHERE DocMeta.dID = 503528

  • Can a fusion web application run on smart phones also? Then what about database for mobiles?

    Sir,
    Can a fusion web application run on smart phones also? Then what about database for mobiles?
    Regards

    Any web application can run on smart phone because you are accessing it from browser so no need for database or application server on your mobile
    It is same as accessing any website on mobile
    If you are talking about mobile app
    check this - http://www.oracle.com/technetwork/developer-tools/adf-mobile/overview/adfmobile-1917693.html
    Ashish

  • What is Database instance

    Hi
    i just clarified my doubt in central instance !!1
    Can any one tell what is database instance ?
    Regards
    sanjeev

    Hi
    The database instance is a mandatory instance for the installation of an SAP system. The SAP system usage types AS ABAP and AS Java use their own database schema in the same database.It contains all the database related services.
    You have a database now sap instance creates a schema on that database and uses this schema for its operations.
    Also visit :http://service.sap.com/instguides
    Reward points if useful

  • What is Database Commit and Database Rollback.

    What is Database Commit and Database Rollback.

    Hi Sir ,
    Please have a look below .Hope it is suitable and simpler solution for your question.
    Please do reward if useful.
    Thankx.
    In database level this will be used..
    Commit is nothing but SAVE the current record..
    If u rol back before commit means whatever u proceeded for the SAVING will be roll back and the data will not be stored..
    This will be used,When some times u r filling a register form..after filling 20 fields,In the 21st field u will not to registrer means it will be rollbacked using the Rollbeck command.
    In detail--->
    ROLLBACK->
    In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.
    · Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.
    · As a result of a ROLLBACK, a new transaction is implicitly opened.
    In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.
    In a restart, the system checks which transactions were canceled or closed with a ROLLBACK. The actions are these transactions are undone.
    COMMIT->
    In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.
    · Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.
    · As a result of a COMMIT, a new transaction is implicitly opened.
    In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.
    In a restart, the system checks which transactions were closed with a COMMIT. These actions are redone. Transactions not yet closed with a COMMIT are undone.
    From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.
    the statements
    COMMIT WORK.
    and
    ROLLBACK WORK.
    for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

  • What is mean by index range scan and fast full scan

    What is mean by the following execution plans
    1)Table access by index rowid
    2) Index range scan
    3) Index fast full scan
    4) global index by rowid
    ..etc
    where i can get this information.In what situation CBO take these paths.Can you pls give me a link where i can find all these.I read these long time ago but not able to recollect
    Thanks
    Anand

    Oracle® Database Performance Tuning Guide
    10g Release 2 (10.2)
    Part Number B14211-01
    13.5 Understanding Access Paths for the Query Optimizer
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm#sthref1281

  • In what way can an index go in invalid state????????

    I did a lot of activity in my database and i found one of my index is in invalid state...i got an error
    ......Error occured is ORA-01502: index 'MUMBAI.SYS_C0013323' or partition of such index is in unusable state......
    Can anybody tell me what activity (or set of activies) can lead to invalid state of Index????/
    How to check if any other index is is Invalid state????????
    Thanx in Advance
    Gagan

    Hello,
    Following are some reason for index to be marked UNUSED;
    Operations like Import Partition or conventional path SQL*Loader
    that offer an option to bypass local index maintenance. When the
    Import is complete, the affected local index partitions are marked
    IU.
    Partition maintenance operations like ALTER TABLE MOVE PARTITION
    that change rowids. These operations mark the affected local index
    partition and all global index partitions IU.
    Partition maintenance operations like ALTER TABLE SPLIT PARTITION
    that modify the partition definition of local indexes but do not
    automatically rebuild the index data to match the new definitions.
    These operations mark the affected local index partitions IU. ALTER
    TABLE SPLIT PARTITION also marks all global index partitions IU
    because it results in changes to rowids.
    Index maintenance operations like ALTER INDEX SPLIT PARTITION that
    modify the partitioning definition of the index but do not
    automatically rebuild the affected partitions. These operations
    mark the affected index partitions IU. However, if you split a
    USABLE partition of a global index, resulting partitions are created
    USABLE. If the partition that was split was marked IU, then so are
    the partitions resulting from the split. Note that dropping a
    partition of a global index that is either IU or is not empty causes
    the next partition of the index to become IU.
    Above points are mentioned at Metalink.
    Hope that this will help you.....

  • What about Full-text indexing and search?

    Great idea!
    Has ORACLE NoSQL db this feature?
    What about indexing/search using multiple languages simultaneously?
    Thank you.

    Hello Oleg,
    Oracle NoSQL Database does not have these features. We may be considering them in a future release.
    Charles Lamb

Maybe you are looking for

  • How do i make my iphone 5 bluetooth not discoverable

    How do i make my iphone 5 bluetooth feature "not" discoverable so that my phone is secure from hacking while i am in public and the bluetooth feature is turned on.

  • Is there a way to prevent a PDF file from being forwarded?

    is there a way to prevent a PDF file from being forwarded? For example, im a personal trainer and if i send a client a plan via PDF file, i want to make sure that they cannot send it to anyone else. I read about how you can secure a file by creating

  • How do you update the iPod touch 8GB

    How do I update the iPod touch 8GB?

  • Help!!! Can't open Excel file on Curve 8530

    Hi Everyone, I can not open an excel file from a web page when I'm using my Telus web browser. When I click on it it just goes to a blank white page on the internet of coding. I have excel installed on my phone with "Sheet to Go". I'm operating on th

  • Email Template containing approver details

    Hi all,  I am in urgent need of sending the e-mail template to the Approver for approving the request in FIM 2010 containing details as follows:- Approver's Name,Request CompletedTime and request Timeout I have already tried [//Request/ComputedActor]