Home > Ask the Oracle Experts > (Archive) SQL and PL/SQL Questions & Answers > Concatenating a null character affecting performance
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Concatenating a null character affecting performance

Azim Fahmi EXPERT RESPONSE FROM: Azim Fahmi

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 29 April 2005

Original: (taking 16 mins)

SELECT DISTINCT FIRST_NAME, LAST_NAME
FROM View1@db_link
WHERE NUM = '14718'
AND UPPER(RNAME) = 'MARKETING';
Modified: (taking 1 sec)
SELECT DISTINCT FIRST_NAME, LAST_NAME
FROM View1@db_link
WHERE NUM = '14718'
AND UPPER(RNAME)||'' = 'MARKETING'; 
Any idea how does concatenating a null character makes so much of difference? The explain plan for both the queries are same. I think there is a FBI (function based index--UPPER(RNAME)) on the RNAME col. Appending a null character ('') to UPPER(RNAME) stops using the index. As we know indexes improves the performance, but in this case, it seems using an index is hampering the performance. I just wanted to know the reason and logic behind this. Can you clarify this?

>
EXPERT RESPONSE
Are underlying tables that are sources for the view residing in the remote database analyzed? In that case the cost based optimized may think that using the function based index versus the index on num column is the best way to execute the query, when in reality using the index on the num column is a better choice.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
(Archive) SQL and PL/SQL
ORA-01654 even though maxextents defined as unlimited
Read, process and write a text file to the database
Generating a 10 character alphanumeric sequence
Working with InterDev and DreamWeaver
Line placement in an EMESSAGE
Searching for stored reservation dates in a database
Specifying a column as NULL
Write a SQL script with optional arguments
Error message while trying to write a Pl/SQL block
Why do many DBMS push their own programming languages?

Oracle SQL
SQL to count values of a status code
Counting NULL columns
Detail rows for accounts that occur three times
Counting a row's NULL columns
Oracle's free SQL Developer adds database migration tool
Latest transaction if no recent prior transactions
Three ways SQL can count rows by type
SQL to select only certain times within a date range
Oracle SQL to test for numerics
Number of rows in multiple tables
Oracle SQL Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
autonomous transaction  (SearchOracle.com)
CFML  (SearchOracle.com)
dynamic SQL  (SearchOracle.com)
foreign key  (SearchOracle.com)
Java Database Connectivity  (SearchOracle.com)
Open Database Connectivity  (SearchOracle.com)
Oracle  (SearchOracle.com)
stored procedure  (SearchOracle.com)
The Open Group  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2003 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts