REPORT ON SQL TUNING USING INDEXING

Size: px
Start display at page:

Download "REPORT ON SQL TUNING USING INDEXING"

Transcription

1 REPORT ON SQL TUNING USING INDEXING SUBMITTED BY SRUNOKSHI KANIYUR PREMA NEELAKANTAN CIS -798 INDEPENDENT STUDY COURSE PROFESSOR Dr.TORBEN AMTOFT Kansas State University Page 1 of 38

2 TABLE OF CONTENTS INTRODUCTION... 4 CREATING AND MAPPING THE PLAN_TABLE... 4 PLAN_TABLE... 4 PLAN_TABLE COLUMN DESCRIPTION... 6 EXPLAIN PLAN... 8 EXECUTION PLAN... 8 PRE REQUISITES TO WORK WITH EXECUTION PLAN... 8 ACCESS METHOD IN ORACLE... 9 FULL TABLE SCAN... 9 INDEX SCAN... 9 RANGE SCAN... 9 JOINS NESTED LOOP HASH JOIN ORDERING OF RECORDS SORT INDEXING WHEN/WHERE TO USE INDEXING TYPES OF INDEXING B-TREE INDEX BITMAP INDEX FUNCTION-BASED INDEX COMPOSITE INDEX WHEN NOT TO USE AN INDEX SELECTING AN INDEX INDEXING ON PRIMARY KEY COLUMNS IN TABLES STEP - 1 CREATE BITMAP INDEX ON PRIMARY KEY COLUMN STEP - 2 REMOVE THE BITMAP INDEX AND USE B-TREE INDEX ON CUID COLUMN OF THE CUSTOMER TABLE INDEXING ON FOREIGN KEY COLUMNS IN TABLES STEP - 1 USING B-TREE INDEX IN BOTH PRIMARY KEY AND FOREIGN KEY STEP - 2 USE B-TREE INDEX ON A PRIMARY KEY AND BITMAP INDEX ON A FOREIGN KEY FUNCTION BASED INDEX (FBI) STEP - 1 EXECUTING QUERY WITHOUT FUNCTION BASED INDEX STEP - 2 EXECUTING QUERY WITH FUNCTION BASED INDEX COMPOSITE INDEX STEP - 1 EXECUTING THE QUERY WITHOUT COMPOSITE INDEX Page 2 of 38

3 STEP - 2 EXECUTING THE QUERY WITH A COMPOSITE INDEX EXAMPLES FOR FUNCTION BASED AND BITMAP INDEX BITMAP INDEX FUNCTION-BASED INDEX INDEX MAINTENANCE STEPS TAKEN TO MONITOR INDEX MONITORING INDEX USAGE VIEW V$OBJECT_USAGE MONITOR INDEX MONITORING INDEX SPACE COMPUTING STATISTICS VALIDATE INDEX CHECK THE INDEX_STATS VIEW CONDITIONS TO DROP AN INDEX REFERENCE Page 3 of 38

4 SQL TUNING USING INDEXING INTRODUCTION There are many applications that interact with database to store and retrieve information from tables. Data storage and retrieval is done by issuing SQL commands to that particular table and the time taken to store/retrieve the data determines an application s efficiency. SQL tuning using indexing is one way to improve an SQL queries performance. The following sections are identified in this report to improve a query s performance, An explain plan in Oracle is used to see how a query is executed to retrieve data To know about various index types and its usage Identify the effectiveness of various indexes To monitor and improve performances of stale/unused indexes CREATING AND MAPPING THE PLAN_TABLE PLAN_TABLE When an SQL query is run, Oracle prepares an execution plan for that query to retrieve the result. Explain plan statement requires a plan_table to store the explanation of the query in the form of queries. The plan_table can be created locally for individual schema. Step 1 - Oracle package come with UTXPLAN.SQL in the $ORACLE_HOME/rdbms/ admin directory. I have used this script to create the plan_table in my schema Page 4 of 38

5 Step 2 Logged in SQL plus with my username and ran this script and the plan_table was created under SRUNOKPN schema. Page 5 of 38

6 PLAN_TABLE column description Statement ID This is used to identify the SQL statements which I have run. Since I have created a plan_table under my schema the statement ID is set to take my username for every SQL statement I run Timestamp gives the date/time when the SQL query was executed. Remarks Comments on the SQL statements can be updated after executing the query Operation The first row created for a statement will be either one of the following CRUD operation (i.e. whether it s a select, update, delete or insert operation). The other rows few rows can be Sort, Index, Table access depending on the access that is being performed on the SQL query. Option The value in this field largely depends on the operation performed. It can be either full table scan or range scan Object_owner Specifies the table owner name. We can access data from other schemas provided we have access privileges to other schema. Page 6 of 38

7 Object_name name of the table or view used in this SQL query Optimizer current option chosen by the database based on the SQL query Cost- The database can choose Cost-based optimizer when given a choice but it depends on the resources utility for retrieving the data. (The resources here are the CPU_COST & IO_COST). If the optimizer chooses Rule-based optimizer then the value of this field will be 0. CPU_COST Number of machine cycles to determine the cost IO_COST Number of datablocks accessed to retrieve the data Step 3 Map the plan_table to SRUNOKPN schema, so that when ever a query is run and explain plan command is issued all the rows will be inserted in this table found under this schema. Page 7 of 38

8 EXPLAIN PLAN EXECUTION PLAN To run an SQL query, oracle performs various operations in the background i.e. to retrieve the result directly from the database or makes it ready for the user to execute the SQL or does both. This type of method which Oracle employs is called the Execution plan. The execution plan s result is stored in plan_table (SRUNOKPN.PLAN_TABLE). Each rows inserted into this table can be different, i.e. It can specify the table access method for the given SQL statement i.e. either by full table scan or Index scan (if the column given in the condition is indexed) or Range scan (if there are no index or if it couldn t find the appropriate index to retrieve the data) Join method used for retrieving data from multiple tables The way in which ordering is performed on a dataset which can be sort or filter operation Pre requisites to work with execution plan To make sure we have access permissions to read and edit the table contents which the SQL statements accesses. To make sure that we can insert rows into plan table if it is under a different schema and also access to view the output from plan_table I am using TOAD to view the results of Explain plan Page 8 of 38

9 ACCESS METHOD IN ORACLE Full table scan Oracle retrieves records after accessing the entire table. Fig.1 shows 2 things, (1) that a fulltable scan is done on the CUSTOMER table in SRUNOKPN schema to retrieve the necessary records in the table (access method). (2) The cost for running the query is NULL which means that the optimizer has used Rule based optimizer to execute this query. Usually full-table scan is not advisable for large tables. (Fig. 1 Full table scan result which shows that all the rows in customer table has been accessed to return the result set) Index scan Indexing is usually done on a column that is unique or often used. By doing this on such columns it enable SQL statement to retrieve data faster. It is one of the efficient methods used in improving the performance of the query Range scan The data is accessed by using row id, which is a pseudo column in Oracle and every row in a table is associated with a unique id. A row id gives granular detail about the location of a row i.e. it leads to the location of the file, the block & finally to the slot where the data exists. If the row id is know, then this access method is the quickest way of retrieving data Page 9 of 38

10 JOINS Nested loop Nested loop is used by SQL statements that access multiple columns from different tables to retrieve results. When two tables are used in SQL statement, then all the rows in the first table satisfying the given where condition is returned and then the result of the first table probes the second table to return result satisfying each row in the first table. The result for the second table is obtained by performing either full table scan (FTS) or by index. An example of the nested loop is given by the following SQL statement which returns all the customers who are both in customer and citation table. select cuid, cuname,pc_number from customer, citation where cuid = pc_cuid and substr(pc_number,1,2) = '07'; (Fig. 2 shows the two tables that are nested i.e. customer & citation table. CUID is the primary key for customer table and PC_CUID is the foreign key in citation table) Understanding the explain plan for the above diagram, Nested loops means there exists a join condition between the citation and customer table Table access full (SRUNOKPN.CITATION) means full table scan is done for citation in SRUNOKPN schema But the customer table is accessed returns records based on the unique value of the table. In customer table CUID field is the primary key which is always unique and the customer table retrieves distinct row when using this unique column and the Table access by index rowid (SRUNOKPN.CUSTOMER) means the table returns the result set based on the records returned by INDEX UNIQUE SCAN which is the CUID field Hash Join When a large table is joined to a small table, the efficiency in retrieving the might be a big question. To avoid such situations Oracle s hash join is used. When the SQL statement is executed, hash join takes every single row of the first table (small table) and produces a hash value for each row using hash algorithm and stores it in a hash table. It performs the same action for the second (larger table). Then it looks for a matching hash value for the large table with the previously generated hash value of the small table, if it matches then the result is produced. For Page 10 of 38

11 example, the following SQL statement returns all customers who have received citations. A customer can receive n number of citation. So there exist one-to-many relationships between these tables. select /*+ use_hash(customer)*/ cuname, pc_number from customer, citation where cuid = pc_cuid; (Fig. 3 Shows the Hash join between two tables) Understanding the explain plan for the above diagram, Table access full (SRUNOKPN.CUSTOMER) means full table scan is performed on customer table. Table access full (SRUNOKPN.CITATION) means full table scan is performed on citation table and all the citations matching the customer records in the customer table is returned as the result. Hash join specifies that the small table in this query customer table joins the large table i.e. citation table. The hash join can be used only if the hash_join_enabled feature is set TRUE in init.ora file. The following figure shows that that property has been set true in my init.ora file. Page 11 of 38

12 ORDERING OF RECORDS There are various operations to perform ordering operations, i.e. either by sort or filter Sort Page 12 of 38

13 (Fig 5 shows that the records returned are ordered based on the sort operation. Sorting operation should not be used for large tables because it affects the performance of a query.) INDEXING Indexing is one of the best ways to improve the performance of a query. Index is an access to point to rows of data using which the result set of a query is retrieved faster. This property can be utilized to the maximum if the appropriate index is used and the improvement is visible only when the correct columns are indexed. When/where to use indexing The columns that have high selectivity(i.e. often used in the where clause) are indexed Columns that have high cardinality(i.e. unique data) needs to be indexed Primary key columns are automatically indexed. But to improve the performance in those tables additional indexing can be done (as one table can have more than one index provided it doesn t affect the performance of other index) Foreign key columns needs to be indexed which are often used in constraint checks. TYPES OF INDEXING There are various types of indexes that can be used based on the query s performance. This section discusses about the index types. B-Tree index Page 13 of 38

14 This index is in tree structure which has a root node and all the values that are greater than the root node values are found on the right side and the values less than the root node are found to the left side. Each data is associated with a value (rowid) and the index looks up for that value to retrieve the result set of the query. Whenever a basic index is created without specifying the type, then a B-tree index is normally created. These are usually used in the columns with high cardinality and high selectivity. Since the entered data is always in specific order sorting is quickly performed on a large amount of data. When a primary key is created an index is automatically created and this index type is B-Tree index. An example of B-Tree index column can be department id. Bitmap index Bitmap index are created for the columns with less unique value. The bitmaps are often compressed and stored to save table space for indexing. They are easily decompressed to retrieve the necessary values. Since the bitmap indexes are compressed, it is important to create these indexes on columns that have lesser CRUD operations performed on it. A popular example of bitmap index columns is the gender column with values M/F. Function-based index Function based index are an advanced way of performing indexing. In traditional method only the columns are indexed, but with this type even an expression, SQL function can be used as index for faster data retrieval. This index type can be used for more powerful sorts like caseinsensitive sorts. But unlike other indexes FBI can be used only by cost-based optimizer (CBO), because Oracle requires statistics to use this index. Analyze tables/index should be done before using the index. No aggregate functions can be used in FBI. These index columns can work only with non-null values. Though there are more restrictions in using this index, when correctly indexed they tremendously improve a query s performance. An example of function-based index is to change the mixed case columns (like abcdefgh) to either lower/uppercase word before sorting. Composite index Composite index are created by joining two or more columns. The indexing can be done on those columns that are often used together to improve the performance. Also columns that are used in join conditions can be used in composite index. When not to use an index Indexing should not be done on columns that have lot of null values. Number of indexes per table should be kept minimal, otherwise it causes additional index overhead and can worsen a query s performance. Page 14 of 38

15 Columns that are very frequently updated should not be indexed. Small tables need not have indexes as it would retrieve data faster without an index. Based on the processing time using Explain plan or SQL trace facility it can be decided if a column needs to be indexed or not. SELECTING AN INDEX There are certain conditions that need to be satisfied before indexing the columns. Some of these conditions and index analyzed and used in the columns 1. INDEXING ON PRIMARY KEY COLUMNS IN TABLES When the primary key of a column is selected, that column automatically uses B-tree index. This is because the B-tree index is used on the columns with unique values and has the entered value in an ordered list. But in this case study, B-tree indexing can be removed and Bitmap index can be used to compare the differences. Step - 1 Create Bitmap index on primary key column Here the CUID is the primary key column of the CUSTOMER table. To perform the experiment, remove B-tree index from the column CUID of the CUSTOMER table and create Bitmap index on the same column. The differences can be noticed through execution time and explain plan Page 15 of 38

16 (Fig 1(a) shows the index CUST_EMPNO_BMX properties and it shows that the column CUID is using Bitmap index, which is the primary key of the CUSTOMER table) After creating a Bitmap index on CUID, a simple query is run to retrieve the row satisfying the given condition. The result of the execution time and explain plan for the SQL query is given in fig 1(b) & 1(c). Query 1 select * from customer where cuid = 6112; Page 16 of 38

17 (Fig-1(b) the highlighted line in the fig shows the execution time for the Query - 1) It has actually taken 16 msecs to run the Query 1 using Bitmap index. (Fig-1(c) shows the explain plan for Query - 1) It has made use of the bitmap index CUST_EMPNO_BMX for retrieving the result. Also the cost for executing the Query-1 is shown because Oracle uses Bitmap index in its execution plan only after a table is analyzed. Step - 2 Remove the Bitmap index and use B-tree index on CUID column of the CUSTOMER table Page 17 of 38

18 (Fig-1(d) shows the B-tree index CUID on the table CUSTOMER ) Since the value in this column is unique, I have marked it as a primary key. When a primary key is selected, a B-tree index is automatically created on that column. Fig 1(e) & 1(f) shows the explain plan & execution plan for the B-tree index. (Fig-1(e) shows the explain plan for B-tree index on CUID column after executing Query - 1) The explain plan shows that Oracle has made use of CUID index in retrieving the result that matches the given condition in Query-1. Page 18 of 38

19 (Fig-1(f) shows the execution time for Query 1 after using B-tree index) The execution time for Query-1 using B-tree index is 15 msecs unlike Bitmap index for the same query which took 1 msec extra to retrieve the same result. From step (1) & (2) s execution time and explain plan, the following reasons are inferred and a decision is made based on these reasons, Each record in the table is unique and is associated with a unique rowid. When a query is executed the B-tree index looks up on the rowid and retrieves the result. Whereas in Bitmap index, the values are not unique and so are stored in compressed manner i.e. in bitmaps. So when a query is executed the Bitmap index has to first decompress the bitmap data and convert it into rowids which are usually used by Oracle to locate data. This conversion will take time to retrieve the records with unique value. Another reason to use B-tree index is because these column values will be used in join conditions/ constraint checks. The execution time is more important in such situations. Also the data is stored in an ordered manner and so ORDER BY function produces more efficient results. So it is good to use B-tree index on primary key which will retrieve data in an ordered and efficient manner. 2. INDEXING ON FOREIGN KEY COLUMNS IN TABLES Foreign key columns are indexed to improving the performance of join condition. The foreign key can use either B-tree index or Bitmap index. The differences in using both indexes are explained below. The CUID column in the CUSTOMER table is the primary key column and PC_CUID in the CITATION table is the foreign key column. The following query is used in testing this process, Query - 2 select * from customer, citation where cuid = pc_cuid and p_cuid = 6112; Step - 1 Using B-tree index in both Primary key and Foreign key Primary key will have B-tree index, because it has already been experimented and decided. In this step an experiment is done on Foreign key using B-tree as its index. The execution time is Page 19 of 38

20 used to identify the time taken to run a query and explain plan is used to check if Oracle has used the index in retrieving the result or not. (Fig 1(g) shows the execution time for Query - 2 after a B-tree index is created on Foreign key ) After indexing the Foreign key and using the column in constraint checks, it has taken 32msecs for Oracle to retrieve 392 rows. (Fig-1(h) shows the explain plan Query - 2 after indexing PC_CUID ) Page 20 of 38

21 Here the explain plan shows that the index unique scan has been done on the customer table as the CUID column has unique value and also it s the primary key column of that table. This means that Oracle looks into the index CUID and retrieves the rowids associated with the table rows. Whereas an index range scan is done on the pc_cuid column of the citation table, this is because the pc_cuid column returns more than one row for the given condition. As the citation table has non-unique values and it is the subset of customer table. Step - 2 Use B-tree index on a Primary key and Bitmap index on a Foreign key. The Bitmap index is normally used in columns with non-unique or null values. Since the PC_CUID is a foreign key column, Bitmap index is used in this column. As a customer can receive n number of citation and each of this citation are stored in the citation table with cuid as the reference number. The experiment is analyzed using explain plan and execution time. (Fig-1(i) shows the execution time after using Bitmap index on PC_CUID column) After using Bitmap index on PC_CUID column, the execution time has reduced to half, i.e. with Btree index it took 32 msecs to execute the query whereas with Bitmap index it has actually taken only 16 msecs to retrieve the same result set. Page 21 of 38

22 (Fig 1(j) shows the explain plan for PC_CUID column with Bitmap index) The PC_CUID_BMX compresses the data and builds a bitmap. The bitmap are then decompressed and then converted into rowids which are easily identified by Oracle to retrieve the result set from citation table. From Steps (1) & (2) s execution time it can be said that Foreign keys when using Bitmap indexes improves performance than using B-tree index. 3. FUNCTION BASED INDEX (FBI) Function based index are the created on expressions/ functions using the columns of a table. The value of these functions is stored in the index and is readily used when these functions are used in a query. For this index a comparative study is done on a query with FBI and without FBI. Step - 1 Executing query without Function based index The following query is used to test this index type. The highlighted part of the where condition is the expression to be used in index. But here in this step the query is run without using the index and difference is noted Query 3 select * from citation where trunc(to_date('11/13/2008','mm/dd/yyyy')-pc_date_issue) > 500; This query displays the citations that are older than 500 days as of Nov 13, Page 22 of 38

23 (Fig-1(k) shows the execution time for Query 3 to retrieve result without using the function based index) It has taken 32 msecs to execute the query without FBI. (Fig-1(l) shows the explain plan for Query 3 to run without using function based index) Page 23 of 38

24 From Fig-1(l) it can be seen that Oracle has performed full table scan to get the result set satisfying the given expression. Because that the best option it was able to find as the expression was not indexed. Step - 2 Executing query with Function based index In this step an index FNIDX_OVERDUE is created for the highlighted expression in the above given query. The expression is pre-compiled and the results are stored in index. So whenever an expression is queried upon, Oracle searches the index and displays the stored values instead of performing full table scan. An example can be seen in the following explain plan & execution plan, (Fig-1(m) shows the execution time of Query 3 after using the function-based index) After the FNIDX_OVERDUE index is created, the execution time of the query is 15 msecs which is nearly half the time taken without function based index. (Fig-1(n) shows the explain plan for the Query - 3) The explain plan shows that Oracle has chose to use the function based index when the indexed expression is used in the query. Also note that the cost of executing the query appears in this, it because just like the Bitmap index, Oracle will use function based index only if the table & index is analyzed. Page 24 of 38

25 Case-1 In one of my business situations I need to get a list of all citations that are more than 250 days old. In this type of situation I can use Function-based index as given above to store all the citations that satisfy the given condition in an index. By doing this type of indexing, data is retrieved faster and improves the performance of my PL/SQL script. 4. COMPOSITE INDEX More than one column can be combined and used as index. This type of indexing is called composite index. Explain plan and execution time can be used to better understand this type of indexing. Step - 1 Executing the query without composite index The query used in both the steps is given below, Query 4 select * from customer where cuname like 'S%' and cu_pec_id = 12; (Fig-1(o) shows the execution time for Query - 4) It has taken 47 msecs to display 19 records without indexing the two columns which are often used together. Page 25 of 38

26 (Fig-1(p) shows the explain plan for the Query - 4) The explain plan shows that Oracle has performed full table scan on the customer table to retrieve the 3 rows satisfying the two conditions i.e. the name should start with the letter S and it should belong to customer group 12 i.e. the Graduate students. Step - 2 Executing the query with a composite index Composite index cbi_indx_grp is created for the 2 columns that are highlighted in the query (CUNAME & CU_PEC_ID). The explain plan & execution time will show the difference in executing the same query with this index. (Fig-(q) shows the execution time for Query 4 after creating a composite index) The execution time shows that it has taken 16 msecs to display the result for the same query which is used to display 19 records and with the same condition. Page 26 of 38

27 (Fig-(r) shows the explain plan for Query - 4) Explain plan shows that Oracle has made use of the composite index to check the conditions and to display the result. From step (1) & (2) s execution time and explain plan it can be said that using composite indexes on columns are used together in checking condition helps in improving the performance of the query. Note A primary key column can be used as one of the columns in composite indexing, but in such situations Oracle will choose to use B-tree index on the primary column rather than composite index. E.g. The CUID and CUNAME columns in the customer table can be used to create another composite index. The table below shows the index description, Page 27 of 38

28 (Fig-(s) shows the description of the composite index (CBI_CUID)) The highlighted columns (CUID, CUNAME) are used in the composite index CBI_CUID. CUID is the primary key column for the customer table & the existing B-Tree is not removed for that table. Now the interpretation of execution plan for the following query is given below, Query 5 select * from customer where cuname like '%LL%' and cuid=5206 ; When the above given query is executed we expect Oracle to take the composite index to execute the results as both these columns are combined and indexed. But when the query is run it actually Page 28 of 38

29 uses the B-tree index on CUID column rather than using composite index. Because a B-tree indexed column has unique value and retrieves data faster than other types of indexing. (Fig-(t) shows the explain plan for Query - 5) EXAMPLES FOR FUNCTION BASED AND BITMAP INDEX Bitmap index Bitmap indexes are mainly used in dataware housing. Columns that are used in data analysis can be indexed with bitmaps. They work at their best for equality operators E.g. In my application, at the end of every month I need to get the account receivables for all the unpaid citations with different statuses. In such situations I can index the PC_STATUS column in the CITATION table, which in turn will compress all the citations with the same status. When a query is issued to get a count of all citations based on their citation status and the query used is, Query - 6 select pc_status, count(pc_number) from citation group by pc_status; (Fig 1 shows the explain plan for Query -6) Page 29 of 38

30 The Fig-1 above shows gives the explain plan for the Query-6 Oracle has performed a full table scan on the table to get the desired result. (Fig -2 shows the PC_STATUS_BMP index creation) It has actually taken 718msecs to create an index for rows. The row above index creation gives the time taken to run Query 6 and it has actually taken 407 msecs to execute and display the result. (Fig 3(a) shows Query-6 execution time after index creation) (Fig 3(b) shows Query-6 explain plan after index creation) Fig-3(a) shows that it has actually taken 31msecs to execute the same query and Fig-3(b) shows that Oracle used the index PC_STATUS_BMP for executing Query -6 Page 30 of 38

31 Function-based index Function-based index can be used in queries that returns a value for an expression E.g. To get a list of customer who have received citation in Manhattan campus and this can be given by the following query, Query-7 select * from citation where substr(pc_number,3,1) = 'M'; (Fig 4 shows the execution time for Query 7 before using function-based index) Query-7 has taken 32 msecs to retrieve the result without function based index (Fig 4(a) shows the execution time for index creation and Query-7 execution time) The highlighted part in red color shows that Oracle has taken 5 secs to create the function based index PC_NUMBER_FBI for records records satisfy the given expression i.e. they all are manhattan citation. When Query-7 is executed it uses the index PC_NUMBER_FBI to retrieve the rows which are already stored in the index. The execution time for the same has reduced by ½ i.e. it has taken only 16 msecs to display the result. Page 31 of 38

32 Note In the CIATION table, PC_NUMBER is the primary key column (using B-tree index) and has unique values in that column. When using that column in the conditional field we expect Oracle to choose PC_NUMBER index but the condition given in Query-7 uses an expression in the conditional field. PC_NUMBER_FBI is created using the exact same expression and all the row in that table is precompiled and stored within the index. So when the Query-7 is executed Oracle prefers PC_NUMBER_FBI than PC_NUMBER index. This can be proved using the explain plan shown in Fig 4(b) INDEX MAINTENANCE When the CRUD operations are issued on a table, the records are prone to changes and it might cause overhead to the index associated with the columns of those tables. This usually happens because each index is associated with a statistics and when the column s data undergoes changes the statistics becomes outdated which will make the queries to run slowly that was earlier running efficiently. Such indices problem can be avoided by keeping track of an index space and its usage. This section deals with the ways to monitor an index and to maintain its usefulness. STEPS TAKEN TO MONITOR INDEX The following steps needs to be done periodically for all the indexes that has been created on the columns of a table, The index used in my examples is PC_NUMBER which is a B-tree index created on the column PC_NUMBER in the table CITATION. MONITORING INDEX USAGE 1. VIEW V$OBJECT_USAGE This view is helpful when the monitoring of an index starts. The view V$OBJECT_USAGE displays the following columns INDEX_NAME Name of the index TABLE_NAME Table name of the column for which the index has been created Page 32 of 38

33 MONIORING - It has the Boolean value (YES/NO) to specify if the index as mentioned in INDEX NAME column is used or not USED This column too has Boolean value (YES/NO) to specify if an index is still used or not START MONIORING This column displays the data & time when the monitoring for the index was started STOP MONIORING - This column displays the data & time when the monitoring for the index was stopped (Fig - 1 shows the initial status of the index PC_NUMBER ) It can be seen from Fig-1 that monitoring for the index has not yet started, so it is not easy to see if the index is being used or not. 2. Monitor index This step is done to start monitoring the usage of an index. It can be invoked by using the command ALTER INDEX PC_NUMBER MONITORING USAGE; (Fig-2 (a) Shows that monitoring has started for the index PC_NUMBER ) The Fig-2 (a) shows that the monitoring has started but as far as the usage is concerned the index is still not used, which shows that none of the query has currently made use of the index after the monitoring has started. The query used in this example is, Query -8 select * from customer, citation where pc_cuid = cuid and pc_number like '08M502133'; Page 33 of 38

34 (Fig 2(b) shows the explain plan for Query 8) The explain plan shows that Oracle has used the index PC_NUMBER to retrieve the result satisfying the condition. (Fig 2(c) shows that index PC_NUMBER is used in a query) Index monitor can be stopped using the command, ALTER INDEX PC_NUMBER NOMONITORING USAGE; Page 34 of 38

35 (Fig 2(d) shows that an index monitor for PC_NUMBER is stopped) Note An index monitor can be kept ON to constantly monitor indexes that are not being used often. Every time when the MONITOR USAGE command is issued for an index, the column values in the view V$OBJECT_USAGE may be different. MONITORING INDEX SPACE When an index is created a space is allotted for each index. Depending on the insertion/deletion operations on the columns, the space used may vary. Constant watch on index space should be done to avoid overhead of indexes. The following steps should be done to check the index space, 1. Computing statistics The index whose space needs to be checked must be analyzed first to estimate the current statistics and cost of that index. Index PC_NUMBER is used as an example here. The following command is issued to analyze the index, analyze table citation compute statistics for table for all indexes for all indexed columns; 2. Validate index The index is validated to make sure that the rows in the index are still available in the table. This validation should be done for foreign key index to ensure that all the rows are present in the primary key. It also makes sure that the statistics computed by Analyze index is current. In our example, the index PC_NUMBER is to be validated using the command given below, validate index PC_NUMBER; Page 35 of 38

36 3. Check the INDEX_STATS view The INDEX_STATS view gives the index space used values. There are many columns in the views of which few columns are used to determine the space used by an index. Height gives the total height of the B-tree index Blocks - gives the value of the segment that s has been allocated to the blocks Name index name LF_BLKS Number of leaf blocks BR_BLKS Number of B-tree blocks Del_lf_rows Number of leaf rows that has been deleted Btree_space Total space allotted for B-tree index Pct_used Percentage of space used by the index (Fig 3(a) shows the INDEX_STATS view for PC_NUMBER) The PC_NUMBER is the primary key column for citation table. This view shows that the index has been created on the PC_NUMBER column. PCT_USED shows a blank column, because there is no data in the citation table to determine the space occupied by the index. The total space allotted for B-tree index PC_NUMBER is 7996 which can be seen in the column BTREE_SPACE. Page 36 of 38

37 (Fig 3(b) shows the values of INDEX_STATS view for the index PC_NUMBER after inserting rows in the citation table) Now looking at Fig -3(b) shows the space that the index has occupied after inserting the rows in the PC_NUMBER column. The Btree space allotted for the index has now increased to and also the index has used some 59% of the allotted space. This value can be obtained from PCT_USED column. Now test the space used by the index PC_NUMBER after deleting 7516 rows from the table. Follow instructions from Step 1 - step 3 to get the values of the space used by index. (Fig 3(c) shows the values of INDEX_STATS view for the index PC_NUMBER after deleting rows in the citation table) The space allotted for the index is still the same but the space occupied by the index has reduced by 1% (i.e. from 59% to 58%). By using the above criteria i.e. by monitoring index usage and space used by index it can be decided whether to use an index or drop it. Page 37 of 38

38 CONDITIONS TO DROP AN INDEX Indexes that are no longer used by Oracle queries or application to retrieve the result can be dropped If the performance of a query is not improved by using that index If the cost of dropping the index is less than retaining the same index REFERENCE 1) 2) 3) 4) 5) Page 38 of 38

.. Spring 2008 CSC 468: DBMS Implementation Alexander Dekhtyar..

.. Spring 2008 CSC 468: DBMS Implementation Alexander Dekhtyar.. .. Spring 2008 CSC 468: DBMS Implementation Alexander Dekhtyar.. Tuning Oracle Query Execution Performance The performance of SQL queries in Oracle can be modified in a number of ways: By selecting a specific

More information

Teradata. This was compiled in order to describe Teradata and provide a brief overview of common capabilities and queries.

Teradata. This was compiled in order to describe Teradata and provide a brief overview of common capabilities and queries. Teradata This was compiled in order to describe Teradata and provide a brief overview of common capabilities and queries. What is it? Teradata is a powerful Big Data tool that can be used in order to quickly

More information

SQL Interview Questions

SQL Interview Questions SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic

More information

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine. 1 PL/SQL INTRODUCTION SQL does not have procedural capabilities. SQL does not provide the programming techniques of condition checking, looping and branching that is required for data before permanent

More information

Answer: Reduce the amount of work Oracle needs to do to return the desired result.

Answer: Reduce the amount of work Oracle needs to do to return the desired result. SQL Tuning 101 excerpt: Explain Plan A Logical Approach By mruckdaschel@affiniongroup.com Michael Ruckdaschel Affinion Group International My Qualifications Software Developer for Affinion Group International

More information

Find All Tables Containing Column With Specified Name Oracle

Find All Tables Containing Column With Specified Name Oracle Find All Tables Containing Column With Specified Name Oracle I'M TRYING to find a column called author_last_name in oracle-apex I want to find a possible duplicate of I want to show all tables that have

More information

Oracle 9i Application Development and Tuning

Oracle 9i Application Development and Tuning Index 2NF, NOT 3NF or BCNF... 2:17 A Anomalies Present in this Relation... 2:18 Anomalies (Specific) in this Relation... 2:4 Application Design... 1:28 Application Environment... 1:1 Application-Specific

More information

Unit Assessment Guide

Unit Assessment Guide Unit Assessment Guide Unit Details Unit code Unit name Unit purpose/application ICTWEB425 Apply structured query language to extract and manipulate data This unit describes the skills and knowledge required

More information

7. Query Processing and Optimization

7. Query Processing and Optimization 7. Query Processing and Optimization Processing a Query 103 Indexing for Performance Simple (individual) index B + -tree index Matching index scan vs nonmatching index scan Unique index one entry and one

More information

DumpsKing. Latest exam dumps & reliable dumps VCE & valid certification king

DumpsKing.   Latest exam dumps & reliable dumps VCE & valid certification king DumpsKing http://www.dumpsking.com Latest exam dumps & reliable dumps VCE & valid certification king Exam : 1z1-062 Title : Oracle Database 12c: Installation and Administration Vendor : Oracle Version

More information

Interpreting Explain Plan Output. John Mullins

Interpreting Explain Plan Output. John Mullins Interpreting Explain Plan Output John Mullins jmullins@themisinc.com www.themisinc.com www.themisinc.com/webinars Presenter John Mullins Themis Inc. (jmullins@themisinc.com) 30+ years of Oracle experience

More information

D B M G Data Base and Data Mining Group of Politecnico di Torino

D B M G Data Base and Data Mining Group of Politecnico di Torino Database Management Data Base and Data Mining Group of tania.cerquitelli@polito.it A.A. 2014-2015 Optimizer operations Operation Evaluation of expressions and conditions Statement transformation Description

More information

Data Warehouse Tuning. Without SQL Modification

Data Warehouse Tuning. Without SQL Modification Data Warehouse Tuning Without SQL Modification Agenda About Me Tuning Objectives Data Access Profile Data Access Analysis Performance Baseline Potential Model Changes Model Change Testing Testing Results

More information

When should an index be used?

When should an index be used? When should an index be used? Christian Antognini Trivadis AG Zürich, Switzerland Introduction One of the biggest problems tuning a SQL statement or judging if its execution plan is optimal, is to decide

More information

Oracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL]

Oracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL] Chapter Overview of PL/SQL Programs Control Statements Using Loops within PLSQL Oracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL] Table of Contents Describe a PL/SQL program construct List the

More information

A Unit of SequelGate Innovative Technologies Pvt. Ltd. All Training Sessions are Completely Practical & Real-time

A Unit of SequelGate Innovative Technologies Pvt. Ltd. All Training Sessions are Completely Practical & Real-time SQL Basics & PL-SQL Complete Practical & Real-time Training Sessions A Unit of SequelGate Innovative Technologies Pvt. Ltd. ISO Certified Training Institute Microsoft Certified Partner Training Highlights

More information

CGS 3066: Spring 2017 SQL Reference

CGS 3066: Spring 2017 SQL Reference CGS 3066: Spring 2017 SQL Reference Can also be used as a study guide. Only covers topics discussed in class. This is by no means a complete guide to SQL. Database accounts are being set up for all students

More information

Seminar: Presenter: Oracle Database Objects Internals. Oren Nakdimon.

Seminar: Presenter: Oracle Database Objects Internals. Oren Nakdimon. Seminar: Oracle Database Objects Internals Presenter: Oren Nakdimon www.db-oriented.com oren@db-oriented.com 054-4393763 @DBoriented 1 Oren Nakdimon Who Am I? Chronology by Oracle years When What Where

More information

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office Access 2010 Chapter 2: Relational Databases and Multi-Table Queries 1 Objectives Design data Create tables Understand table relationships Share data with Excel Establish table

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL ORACLE UNIVERSITY CONTACT US: 00 9714 390 9000 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database

More information

Tuning SQL without the Tuning Pack. John Larkin JP Morgan Chase

Tuning SQL without the Tuning Pack. John Larkin JP Morgan Chase Tuning SQL without the Tuning Pack John Larkin JP Morgan Chase Who am I Originally a mainframe COBOL programmer DBA for the last 23 years, the last 15 with Oracle. UNIX (Solaris, Aix, Windows, Linux) Recently

More information

RDBMS Topic 4 Adv. SQL, MSBTE Questions and Answers ( 12 Marks)

RDBMS Topic 4 Adv. SQL, MSBTE Questions and Answers ( 12 Marks) 2017 RDBMS Topic 4 Adv. SQL, MSBTE Questions and Answers ( 12 Marks) 2016 Q. What is view? Definition of view: 2 marks) Ans : View: A view is a logical extract of a physical relation i.e. it is derived

More information

Module 9: Managing Schema Objects

Module 9: Managing Schema Objects Module 9: Managing Schema Objects Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing data integrity using constraints Implementing

More information

CHAPTER. Oracle Database 11g Architecture Options

CHAPTER. Oracle Database 11g Architecture Options CHAPTER 1 Oracle Database 11g Architecture Options 3 4 Part I: Critical Database Concepts Oracle Database 11g is a significant upgrade from prior releases of Oracle. New features give developers, database

More information

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Table of Contents. PDF created with FinePrint pdffactory Pro trial version Table of Contents Course Description The SQL Course covers relational database principles and Oracle concepts, writing basic SQL statements, restricting and sorting data, and using single-row functions.

More information

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012 Outline Database Management and Tuning Johann Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 6 April 12, 2012 1 Acknowledgements: The slides are provided by Nikolaus Augsten

More information

UNIT 4 DATABASE SYSTEM CATALOGUE

UNIT 4 DATABASE SYSTEM CATALOGUE UNIT 4 DATABASE SYSTEM CATALOGUE Database System Structure Page Nos. 4.0 Introduction 65 4.1 Objectives 66 4.2 for Relational Database Management System 66 4.3 Data Dictionary and Data Repository System

More information

University of California, Berkeley. (2 points for each row; 1 point given if part of the change in the row was correct)

University of California, Berkeley. (2 points for each row; 1 point given if part of the change in the row was correct) University of California, Berkeley CS 186 Intro to Database Systems, Fall 2012, Prof. Michael J. Franklin MIDTERM II - Questions This is a closed book examination but you are allowed one 8.5 x 11 sheet

More information

Kathleen Durant PhD Northeastern University CS Indexes

Kathleen Durant PhD Northeastern University CS Indexes Kathleen Durant PhD Northeastern University CS 3200 Indexes Outline for the day Index definition Types of indexes B+ trees ISAM Hash index Choosing indexed fields Indexes in InnoDB 2 Indexes A typical

More information

Oracle 11g Invisible Indexes Inderpal S. Johal. Inderpal S. Johal, Data Softech Inc.

Oracle 11g Invisible Indexes   Inderpal S. Johal. Inderpal S. Johal, Data Softech Inc. ORACLE 11G INVISIBLE INDEXES Inderpal S. Johal, Data Softech Inc. INTRODUCTION In this document we will work on another Oracle 11g interesting feature called Invisible Indexes. This will be very helpful

More information

Oracle Hints. Using Optimizer Hints

Oracle Hints. Using Optimizer Hints Politecnico di Torino Tecnologia delle Basi di Dati Oracle Hints Computer Engineering, 2009-2010, slides by Tania Cerquitelli and Daniele Apiletti Using Optimizer Hints You can use comments in a SQL statement

More information

Course Outline and Objectives: Database Programming with SQL

Course Outline and Objectives: Database Programming with SQL Introduction to Computer Science and Business Course Outline and Objectives: Database Programming with SQL This is the second portion of the Database Design and Programming with SQL course. In this portion,

More information

Oracle Database 11g: SQL Tuning Workshop

Oracle Database 11g: SQL Tuning Workshop Oracle University Contact Us: Local: 0845 777 7 711 Intl: +44 845 777 7 711 Oracle Database 11g: SQL Tuning Workshop Duration: 3 Days What you will learn This Oracle Database 11g: SQL Tuning Workshop Release

More information

MTA Database Administrator Fundamentals Course

MTA Database Administrator Fundamentals Course MTA Database Administrator Fundamentals Course Session 1 Section A: Database Tables Tables Representing Data with Tables SQL Server Management Studio Section B: Database Relationships Flat File Databases

More information

RAID in Practice, Overview of Indexing

RAID in Practice, Overview of Indexing RAID in Practice, Overview of Indexing CS634 Lecture 4, Feb 04 2014 Slides based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke 1 Disks and Files: RAID in practice For a big enterprise

More information

Optimizing Testing Performance With Data Validation Option

Optimizing Testing Performance With Data Validation Option Optimizing Testing Performance With Data Validation Option 1993-2016 Informatica LLC. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording

More information

Table Compression in Oracle9i Release2. An Oracle White Paper May 2002

Table Compression in Oracle9i Release2. An Oracle White Paper May 2002 Table Compression in Oracle9i Release2 An Oracle White Paper May 2002 Table Compression in Oracle9i Release2 Executive Overview...3 Introduction...3 How It works...3 What can be compressed...4 Cost and

More information

Outline. Database Tuning. Join Strategies Running Example. Outline. Index Tuning. Nikolaus Augsten. Unit 6 WS 2014/2015

Outline. Database Tuning. Join Strategies Running Example. Outline. Index Tuning. Nikolaus Augsten. Unit 6 WS 2014/2015 Outline Database Tuning Nikolaus Augsten University of Salzburg Department of Computer Science Database Group 1 Examples Unit 6 WS 2014/2015 Adapted from Database Tuning by Dennis Shasha and Philippe Bonnet.

More information

5. Single-row function

5. Single-row function 1. 2. Introduction Oracle 11g Oracle 11g Application Server Oracle database Relational and Object Relational Database Management system Oracle internet platform System Development Life cycle 3. Writing

More information

Chapter 5: Physical Database Design. Designing Physical Files

Chapter 5: Physical Database Design. Designing Physical Files Chapter 5: Physical Database Design Designing Physical Files Technique for physically arranging records of a file on secondary storage File Organizations Sequential (Fig. 5-7a): the most efficient with

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL)

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management Tenth Edition Chapter 7 Introduction to Structured Query Language (SQL) Objectives In this chapter, students will learn: The basic commands and

More information

Accelerating BI on Hadoop: Full-Scan, Cubes or Indexes?

Accelerating BI on Hadoop: Full-Scan, Cubes or Indexes? White Paper Accelerating BI on Hadoop: Full-Scan, Cubes or Indexes? How to Accelerate BI on Hadoop: Cubes or Indexes? Why not both? 1 +1(844)384-3844 INFO@JETHRO.IO Overview Organizations are storing more

More information

Oracle Database 11g: SQL Tuning Workshop. Student Guide

Oracle Database 11g: SQL Tuning Workshop. Student Guide Oracle Database 11g: SQL Tuning Workshop Student Guide D52163GC10 Edition 1.0 June 2008 Author Jean-François Verrier Technical Contributors and Reviewers Muriel Fry (Special thanks) Joel Goodman Harald

More information

Microsoft Access Illustrated. Unit B: Building and Using Queries

Microsoft Access Illustrated. Unit B: Building and Using Queries Microsoft Access 2010- Illustrated Unit B: Building and Using Queries Objectives Use the Query Wizard Work with data in a query Use Query Design View Sort and find data (continued) Microsoft Office 2010-Illustrated

More information

Indexing and Hashing

Indexing and Hashing C H A P T E R 1 Indexing and Hashing This chapter covers indexing techniques ranging from the most basic one to highly specialized ones. Due to the extensive use of indices in database systems, this chapter

More information

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1 Basic Concepts :- 1. What is Data? Data is a collection of facts from which conclusion may be drawn. In computer science, data is anything in a form suitable for use with a computer. Data is often distinguished

More information

Enterprise Reporting -- APEX

Enterprise Reporting -- APEX Quick Reference Enterprise Reporting -- APEX This Quick Reference Guide documents Oracle Application Express (APEX) as it relates to Enterprise Reporting (ER). This is not an exhaustive APEX documentation

More information

Midterm 1: CS186, Spring I. Storage: Disk, Files, Buffers [11 points] cs186-

Midterm 1: CS186, Spring I. Storage: Disk, Files, Buffers [11 points] cs186- Midterm 1: CS186, Spring 2016 Name: Class Login: cs186- You should receive 1 double-sided answer sheet and an 11-page exam. Mark your name and login on both sides of the answer sheet, and in the blanks

More information

The Oracle Optimizer Explain the Explain Plan O R A C L E W H I T E P A P E R A P R I L

The Oracle Optimizer Explain the Explain Plan O R A C L E W H I T E P A P E R A P R I L The Oracle Optimizer Explain the Explain Plan O R A C L E W H I T E P A P E R A P R I L 2 0 1 7 Table of Contents Introduction 1 The Execution Plan 2 Displaying the Execution Plan 3 What is Cost? 7 Understanding

More information

Oracle SQL Tuning for Developers Workshop Student Guide - Volume I

Oracle SQL Tuning for Developers Workshop Student Guide - Volume I Oracle SQL Tuning for Developers Workshop Student Guide - Volume I D73549GC10 Edition 1.0 October 2012 D78799 Authors Sean Kim Dimpi Rani Sarmah Technical Contributors and Reviewers Nancy Greenberg Swarnapriya

More information

Introduction to Computer Science and Business

Introduction to Computer Science and Business Introduction to Computer Science and Business This is the second portion of the Database Design and Programming with SQL course. In this portion, students implement their database design by creating a

More information

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25 Indexing Jan Chomicki University at Buffalo Jan Chomicki () Indexing 1 / 25 Storage hierarchy Cache Main memory Disk Tape Very fast Fast Slower Slow (nanosec) (10 nanosec) (millisec) (sec) Very small Small

More information

DATABASE PERFORMANCE AND INDEXES. CS121: Relational Databases Fall 2017 Lecture 11

DATABASE PERFORMANCE AND INDEXES. CS121: Relational Databases Fall 2017 Lecture 11 DATABASE PERFORMANCE AND INDEXES CS121: Relational Databases Fall 2017 Lecture 11 Database Performance 2 Many situations where query performance needs to be improved e.g. as data size grows, query performance

More information

Db2 9.7 Create Table If Not Exists >>>CLICK HERE<<<

Db2 9.7 Create Table If Not Exists >>>CLICK HERE<<< Db2 9.7 Create Table If Not Exists The Explain tables capture access plans when the Explain facility is activated. You can create them using one of the following methods: for static SQL, The SYSTOOLS schema

More information

Sql Server Check If Global Temporary Table Exists

Sql Server Check If Global Temporary Table Exists Sql Server Check If Global Temporary Table Exists I am trying to create a temp table from the a select statement so that I can get the schema information from the temp I have yet to see a valid justification

More information

CSE 565 Computer Security Fall 2018

CSE 565 Computer Security Fall 2018 CSE 565 Computer Security Fall 2018 Lecture 12: Database Security Department of Computer Science and Engineering University at Buffalo 1 Review of Access Control Types We previously studied four types

More information

Introduction to Computer Science and Business

Introduction to Computer Science and Business Introduction to Computer Science and Business The Database Programming with PL/SQL course introduces students to the procedural language used to extend SQL in a programatic manner. This course outline

More information

Microsoft. [MS20762]: Developing SQL Databases

Microsoft. [MS20762]: Developing SQL Databases [MS20762]: Developing SQL Databases Length : 5 Days Audience(s) : IT Professionals Level : 300 Technology : Microsoft SQL Server Delivery Method : Instructor-led (Classroom) Course Overview This five-day

More information

Advanced indexing methods Usage and Abusage. Riyaj Shamsudeen Ora!nternals

Advanced indexing methods Usage and Abusage. Riyaj Shamsudeen Ora!nternals Advanced indexing methods Usage and Abusage Riyaj Shamsudeen Ora!nternals Introduction Who am I? Various indexing features Use and abuse of index types Questions Riyaj Shamsudeen @Orainternals 2 Who am

More information

Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course:

Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course: Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course: 20762C Developing SQL 2016 Databases Module 1: An Introduction to Database Development Introduction to the

More information

Storage hierarchy. Textbook: chapters 11, 12, and 13

Storage hierarchy. Textbook: chapters 11, 12, and 13 Storage hierarchy Cache Main memory Disk Tape Very fast Fast Slower Slow Very small Small Bigger Very big (KB) (MB) (GB) (TB) Built-in Expensive Cheap Dirt cheap Disks: data is stored on concentric circular

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the fundamentals of SQL and PL/SQL along with the

More information

VERSION. Version Date Description. Estimate size of B-tree Indexes ! " # $$% & ' ( )*(!+ $ &-+ / ! 5 '9

VERSION. Version Date Description. Estimate size of B-tree Indexes !  # $$% & ' ( )*(!+ $ &-+ / ! 5 '9 VERSION Version Date Description! " # $$% & ' ( )*(!+, -./01))( -#*** $ &-+ / 2 3 4 5 2 62 25 7 8! 5 '9!"-" 5 27/12/2005 Guy Lambregts OCP DBA Steria Benelux Page : 2 1. INTRODUCTION...4 2. HOW MANY LEAF

More information

Online Demo Guide. Barracuda PST Enterprise. Introduction (Start of Demo) Logging into the PST Enterprise

Online Demo Guide. Barracuda PST Enterprise. Introduction (Start of Demo) Logging into the PST Enterprise Online Demo Guide Barracuda PST Enterprise This script provides an overview of the main features of PST Enterprise, covering: 1. Logging in to PST Enterprise 2. Client Configuration 3. Global Configuration

More information

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access Databases and Microsoft Access Introduction to Databases A well-designed database enables huge data storage and efficient data retrieval. Term Database Table Record Field Primary key Index Meaning A organized

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Database Systems: Fall 2017 Quiz I

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Database Systems: Fall 2017 Quiz I Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.830 Database Systems: Fall 2017 Quiz I There are 15 questions and 12 pages in this quiz booklet. To receive

More information

Advanced Data Management Technologies Written Exam

Advanced Data Management Technologies Written Exam Advanced Data Management Technologies Written Exam 02.02.2016 First name Student number Last name Signature Instructions for Students Write your name, student number, and signature on the exam sheet. This

More information

Mastering phpmyadmiri 3.4 for

Mastering phpmyadmiri 3.4 for Mastering phpmyadmiri 3.4 for Effective MySQL Management A complete guide to getting started with phpmyadmin 3.4 and mastering its features Marc Delisle [ t]open so 1 I community experience c PUBLISHING

More information

Appendix: Application of the Formal Principle for the Analysis of Performance Problems After an Oracle Migration

Appendix: Application of the Formal Principle for the Analysis of Performance Problems After an Oracle Migration Appendix: Application of the Formal Principle for the Analysis of Performance Problems After an Oracle Migration The method described in this book is helpful in most cases which a database specialist is

More information

Introduction to SQL/PLSQL Accelerated Ed 2

Introduction to SQL/PLSQL Accelerated Ed 2 Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Introduction to SQL/PLSQL Accelerated Ed 2 Duration: 5 Days What you will learn This Introduction to SQL/PLSQL Accelerated course

More information

Oracle Database 11g: SQL and PL/SQL Fundamentals

Oracle Database 11g: SQL and PL/SQL Fundamentals Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL

More information

File System Interface and Implementation

File System Interface and Implementation Unit 8 Structure 8.1 Introduction Objectives 8.2 Concept of a File Attributes of a File Operations on Files Types of Files Structure of File 8.3 File Access Methods Sequential Access Direct Access Indexed

More information

Oracle. Exam Questions 1Z Oracle Database 11g Release 2: SQL Tuning Exam. Version:Demo

Oracle. Exam Questions 1Z Oracle Database 11g Release 2: SQL Tuning Exam. Version:Demo Oracle Exam Questions 1Z0-117 Oracle Database 11g Release 2: SQL Tuning Exam Version:Demo 1.You ran a high load SQL statement that used an index through the SQL Tuning Advisor and accepted its recommendation

More information

SQL (Structured Query Language)

SQL (Structured Query Language) Dear Student, Based upon your enquiry we are pleased to send you the course curriculum for Oracle DBA 11g SQL (Structured Query Language) Software Installation (Environment Setup for Oracle on Window10)

More information

Oracle SQL & PL SQL Course

Oracle SQL & PL SQL Course Oracle SQL & PL SQL Course Complete Practical & Real-time Training Job Support Complete Practical Real-Time Scenarios Resume Preparation Lab Access Training Highlights Placement Support Support Certification

More information

JSPM s Bhivarabai Sawant Institute of Technology & Research, Wagholi, Pune Department of Information Technology

JSPM s Bhivarabai Sawant Institute of Technology & Research, Wagholi, Pune Department of Information Technology JSPM s Bhivarabai Sawant Institute of Technology & Research, Wagholi, Pune Department of Information Technology Introduction A database administrator (DBA) is a person responsible for the installation,

More information

Physical Design. Elena Baralis, Silvia Chiusano Politecnico di Torino. Phases of database design D B M G. Database Management Systems. Pag.

Physical Design. Elena Baralis, Silvia Chiusano Politecnico di Torino. Phases of database design D B M G. Database Management Systems. Pag. Physical Design D B M G 1 Phases of database design Application requirements Conceptual design Conceptual schema Logical design ER or UML Relational tables Logical schema Physical design Physical schema

More information

Oracle Database: Introduction to SQL/PLSQL Accelerated

Oracle Database: Introduction to SQL/PLSQL Accelerated Oracle University Contact Us: Landline: +91 80 67863899 Toll Free: 0008004401672 Oracle Database: Introduction to SQL/PLSQL Accelerated Duration: 5 Days What you will learn This Introduction to SQL/PLSQL

More information

Top 5 Issues that Cannot be Resolved by DBAs (other than missed bind variables)

Top 5 Issues that Cannot be Resolved by DBAs (other than missed bind variables) Top 5 Issues that Cannot be Resolved by DBAs (other than missed bind variables) March 12, 2013 Michael Rosenblum Dulcian, Inc. www.dulcian.com 1 of 43 Who Am I? Misha Oracle ACE Co-author of 2 books PL/SQL

More information

Draft. Students Table. FName LName StudentID College Year. Justin Ennen Science Senior. Dan Bass Management Junior

Draft. Students Table. FName LName StudentID College Year. Justin Ennen Science Senior. Dan Bass Management Junior Chapter 6 Introduction to SQL 6.1 What is a SQL? When would I use it? SQL stands for Structured Query Language. It is a language used mainly for talking to database servers. It s main feature divisions

More information

Implementing Table Operations Using Structured Query Language (SQL) Using Multiple Operations. SQL: Structured Query Language

Implementing Table Operations Using Structured Query Language (SQL) Using Multiple Operations. SQL: Structured Query Language Implementing Table Operations Using Structured Query Language (SQL) Using Multiple Operations Show Only certain columns and rows from the join of Table A with Table B The implementation of table operations

More information

Modern Database Systems Lecture 1

Modern Database Systems Lecture 1 Modern Database Systems Lecture 1 Aristides Gionis Michael Mathioudakis T.A.: Orestis Kostakis Spring 2016 logistics assignment will be up by Monday (you will receive email) due Feb 12 th if you re not

More information

1 Prepared By Heena Patel (Asst. Prof)

1 Prepared By Heena Patel (Asst. Prof) Topic 1 1. What is difference between Physical and logical data 3 independence? 2. Define the term RDBMS. List out codd s law. Explain any three in detail. ( times) 3. What is RDBMS? Explain any tow Codd

More information

CHAPTER: 4 ADVANCE SQL: SQL PERFORMANCE TUNING (12 Marks)

CHAPTER: 4 ADVANCE SQL: SQL PERFORMANCE TUNING (12 Marks) (12 Marks) 4.1 VIEW View: Views are virtual relations mainly used for security purpose, and can be provided on request by a particular user. A view can contain all rows of a table or select rows from a

More information

Oracle DB-Tuning Essentials

Oracle DB-Tuning Essentials Infrastructure at your Service. Oracle DB-Tuning Essentials Agenda 1. The DB server and the tuning environment 2. Objective, Tuning versus Troubleshooting, Cost Based Optimizer 3. Object statistics 4.

More information

Oracle Database 11gR2 Optimizer Insights

Oracle Database 11gR2 Optimizer Insights Oracle Database 11gR2 Optimizer Insights Marcus Bender Distinguished Sales Consultant Presales Fellow Strategic Technical Support (STU) ORACLE Deutschland GmbH, Geschäftsstelle Hamburg Parallel Execution

More information

Oracle Syllabus Course code-r10605 SQL

Oracle Syllabus Course code-r10605 SQL Oracle Syllabus Course code-r10605 SQL Writing Basic SQL SELECT Statements Basic SELECT Statement Selecting All Columns Selecting Specific Columns Writing SQL Statements Column Heading Defaults Arithmetic

More information

Midterm 1: CS186, Spring I. Storage: Disk, Files, Buffers [11 points] SOLUTION. cs186-

Midterm 1: CS186, Spring I. Storage: Disk, Files, Buffers [11 points] SOLUTION. cs186- Midterm 1: CS186, Spring 2016 Name: Class Login: SOLUTION cs186- You should receive 1 double-sided answer sheet and an 10-page exam. Mark your name and login on both sides of the answer sheet, and in the

More information

Lecture 07. Spring 2018 Borough of Manhattan Community College

Lecture 07. Spring 2018 Borough of Manhattan Community College Lecture 07 Spring 2018 Borough of Manhattan Community College 1 SQL Identifiers SQL identifiers are used to identify objects in the database, such as table names, view names, and columns. The ISO standard

More information

Certification Exam Preparation Seminar: Oracle Database SQL

Certification Exam Preparation Seminar: Oracle Database SQL Oracle University Contact Us: 0800 891 6502 Certification Exam Preparation Seminar: Oracle Database SQL Duration: 1 Day What you will learn This video seminar Certification Exam Preparation Seminar: Oracle

More information

5 Integrity Constraints and Triggers

5 Integrity Constraints and Triggers 5 Integrity Constraints and Triggers 5.1 Integrity Constraints In Section 1 we have discussed three types of integrity constraints: not null constraints, primary keys, and unique constraints. In this section

More information

Managing Performance Through Versioning of Statistics

Managing Performance Through Versioning of Statistics Managing Performance Through Versioning of Statistics Claudia Fernandez Technical Services Manager claudia@leccotech.com LECCOTECH www.leccotech.com NoCOUG, August 2003 "Managing Performance Through Versioning

More information

1.1 - Basics of Query Processing in SQL Server

1.1 - Basics of Query Processing in SQL Server Department of Computer Science and Engineering 2013/2014 Database Administration and Tuning Lab 3 2nd semester In this lab class, we will address query processing. For students with a particular interest

More information

14 Index selection guidelines 12/08/17 11:42 PM. Index selection guidelines

14 Index selection guidelines 12/08/17 11:42 PM. Index selection guidelines Index selection guidelines 1 To use an index or not to use an index? Main principle Do not build index unless some query (including the query components of updates and deletions) benefits from it Selectivity

More information

Querying Data with Transact SQL

Querying Data with Transact SQL Course 20761A: Querying Data with Transact SQL Course details Course Outline Module 1: Introduction to Microsoft SQL Server 2016 This module introduces SQL Server, the versions of SQL Server, including

More information

Data Vault Partitioning Strategies WHITE PAPER

Data Vault Partitioning Strategies WHITE PAPER Dani Schnider Data Vault ing Strategies WHITE PAPER Page 1 of 18 www.trivadis.com Date 09.02.2018 CONTENTS 1 Introduction... 3 2 Data Vault Modeling... 4 2.1 What is Data Vault Modeling? 4 2.2 Hubs, Links

More information

6232B: Implementing a Microsoft SQL Server 2008 R2 Database

6232B: Implementing a Microsoft SQL Server 2008 R2 Database 6232B: Implementing a Microsoft SQL Server 2008 R2 Database Course Overview This instructor-led course is intended for Microsoft SQL Server database developers who are responsible for implementing a database

More information

CS222P Fall 2017, Final Exam

CS222P Fall 2017, Final Exam STUDENT NAME: STUDENT ID: CS222P Fall 2017, Final Exam Principles of Data Management Department of Computer Science, UC Irvine Prof. Chen Li (Max. Points: 100 + 15) Instructions: This exam has seven (7)

More information

Creating and Managing Tables Schedule: Timing Topic

Creating and Managing Tables Schedule: Timing Topic 9 Creating and Managing Tables Schedule: Timing Topic 30 minutes Lecture 20 minutes Practice 50 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe the

More information

Data about data is database Select correct option: True False Partially True None of the Above

Data about data is database Select correct option: True False Partially True None of the Above Within a table, each primary key value. is a minimal super key is always the first field in each table must be numeric must be unique Foreign Key is A field in a table that matches a key field in another

More information