Character Strings-Datatypes
On 25/07/2024 by Robert CorvinoThere are four basic character string types in Oracle, namely, CHAR, VARCHAR2, NCHAR, and NVARCHAR2. All of the strings are stored in the same format in Oracle. On the database block, they will have a leading length field of 1–3 bytes followed by the data; when they are NULL, they will be represented as a
Auto Indexing Wrap-Up-Indexes
On 07/03/2024 by Robert CorvinoDoes this mean the DBAs and application developers don’t need to worry about indexing anymore? Far from it. Even with automatic indexing, you still need to monitor the system and ensure that the indexing is doing what you think it should do. You’ll haveinsights into your database and application code that the auto indexing feature
Why Isn’t My Index Getting Used?-Indexes-2
On 24/11/2023 by Robert CorvinoCase 4We have indexed a character column. This column contains only numeric data. We query using the following syntax:SQL> select * from t where indexed_column = 5 Note that the number 5 in the query is the constant number 5 (not a character string). The index on INDEXED_COLUMN is not used. This is because the
Invisible Indexes-Indexes
On 21/08/2023 by Robert CorvinoYou have the option of making an index invisible to the optimizer. The index is only invisible in the sense that the optimizer won’t use the index when creating an execution plan. You can either create an index as invisible or alter an existing index to be invisible. Here, we create a table, load it
Function-Based Indexes Wrap-Up-Indexes
On 01/05/2023 by Robert CorvinoFunction-based indexes are easy to use and implement, and they provide immediate value. They can be used to speed up existing applications without changing any of their logic or queries. Many orders of magnitude improvement may be observed. You can use them to precompute complex values without using a trigger. Additionally, the optimizer can estimate
Multiple Indexes on the Same Column Combinations-Indexes
On 26/04/2023 by Robert CorvinoPrior to Oracle Database 12c, you could not have multiple indexes defined on one table with the exact same combination of columns. For example:$ sqlplus eoda/foo@PDB1SQL> create table t(x int);Table created.SQL> create index ti on t(x);Index created.SQL> create bitmap index tb on t(x) invisible; Starting with 12c, you can define multiple indexes on the same
Function-Based Index Solution-Indexes
On 24/04/2023 by Robert CorvinoThe concept here is that you’re building an index and applying a function to it in a way that limits the length of the index key and also results in a usable index. Here, I use the same code (as in the prior section) to create a table with an extended column and populate it
Do Nulls and Indexes Work Together?-Indexes
On 24/03/2023 by Robert CorvinoBTree indexes, except in the special case of cluster BTree indexes, do not store completely null entries, but bitmap and cluster indexes do. This side effect can be a point of confusion, but it can actually be used to your advantage when you understand what not storing entirely null keys implies. To see the effect
Why Isn’t My Index Getting Used?-Indexes-1
On 24/02/2023 by Robert CorvinoThere are many possible causes of this. In this section, we’ll take a look at some of the most common. Case 1We’re using a B*Tree index, and our predicate does not use the leading edge of an index. In this case, we might have a table T with an index on T(x,y). We query SELECT
Index Case Summary-Indexes
On 24/01/2023 by Robert CorvinoIn my experience, these six cases are the main reasons I find that indexes are not being used. It usually boils down to a case of “They cannot be used—using them would return incorrect results,” or “They should not be used—if they were used, performance would be terrible.” Myth: Space Is Never Reused in an