Is there any way to an index that can be used to include the "OR condition "?
Hello I have some questions.
The test was conducted in the following procedure .
create table test
c1 varchar2(10),
c2 varchar2(10),
primary key(c1)
create index test_idx1 on test(c2);
Command> explain select * from test where c1 = 'AAAAAAAAAA' or c2 = 'AAAAAAAAAA';
Query Optimizer Plan:
STEP: 1
LEVEL: 1
OPERATION: RowLkRangeScan
TBLNAME: TEST
IXNAME: TEST
INDEXED CONDITION: <NULL>
NOT INDEXED: TEST.C2 = 'AAAAAAAAAA' OR TEST.C1 = 'AAAAAAAAAA'
Command>
Command> explain select * from test where c1 = 'AAAAAAAAAA' and c2 = 'AAAAAAAAAA'
Query Optimizer Plan:
STEP: 1
LEVEL: 1
OPERATION: RowLkRangeScan
TBLNAME: TEST
IXNAME: TEST
INDEXED CONDITION: TEST.C1 = 'AAAAAAAAAA'
NOT INDEXED: TEST.C2 = 'AAAAAAAAAA'
Command>
By including the "OR condition " in this test does not use the index.
Is there any way to an index that can be used to include the "OR condition "?
Thanks.
GooGyum.
A database cannot in general use indexes in this way for an 'or' involving two different columns. However, for this specific example one can easily rewrite the query using 'UNION' to use the relevant indexes while still giving the same (correct) result:
Command> explain select * from test t1 where t1.c1 = 'AAAAAAAAAA' union select * from test t2 where t2.c2 = 'AAAAAAAAAA';
Query Optimizer Plan:
STEP: 1
LEVEL: 1
OPERATION: RowLkRangeScan
TBLNAME: TEST
IXNAME: TEST
INDEXED CONDITION: T1.C1 = 'AAAAAAAAAA'
NOT INDEXED: <NULL>
STEP: 2
LEVEL: 2
OPERATION: RowLkRangeScan
TBLNAME: TEST
IXNAME: TEST_IDX2
INDEXED CONDITION: T2.C2 = 'AAAAAAAAAA'
NOT INDEXED: <NULL>
STEP: 3
LEVEL: 1
OPERATION: OrderBy
TBLNAME: <NULL>
IXNAME: <NULL>
INDEXED CONDITION: <NULL>
NOT INDEXED: <NULL>
STEP: 4
LEVEL: 2
OPERATION: UnionMergeSort
TBLNAME: <NULL>
IXNAME: <NULL>
INDEXED CONDITION: <NULL>
NOT INDEXED: <NULL>
Maybe you can apply a similar trick? If you know there is no possibility of duplicate rows then you can further optimise this (in terms of performance) by using UNION ALL.
Chris
Similar Messages
-
My Laptop crashed. I had a full backup on Carbonite so the iTunes folder is there and downloadable. Is there any way just to import that and have iTunes on my new computer (Windows 7) recognize it?
Nothing gets imported. Simply restore the ENTIRE iTunes folder to the new/restored computer.
Download and install iTunes from Apple's website.
The first time iTunes is launched, assuming the ENTIRE iTunes folder is restored to the correct location, it will launch and be exactly as it was prior to the comptuer issues. If for some reason this does not work, close iTunes, hold the SHIFT key while launching iTunes and a prompt will appear to choose or create a new iTunes library. At this point simply point iTunes to the correct location for the existing iTunes library. -
Is there any way to retrieve photos that were put in the trash can and then it was emptied? Or is there a way to move photos from an imovie to iphoto?
If you've emptied the trash, ehtn no. However if you have a backup, like Time Machine, or a recent backup copy of your photo library you could recover the photos from the trash.
The answer to getting a snapshot form iMovie depends on what version you have.
I should add it technically may be possible to recover the emptied trash, but if you really want to do that you would need to download a utility software that can attempt to recover deleted files. Do it soon before you start writing more data to that disk. At the moment I don't have a recommendation for such a program. Maybe someone else out there will offer suggestion. -
My daughter's iPhone was stolen. Is there any way to recover photos that she would have backed up to the Cloud? Note, we did not have photoshare running.
Camera roll photos are included in the backup. The backup includes:
Photos and videos in the Camera Roll
Device settings (for example: Phone Favorites, Wallpaper, and Mail, Contacts, Calendar accounts)
App data
Home screen and app organization
Messages (iMessage, SMS, and MMS)
Ringtones
Visual Voicemails
(From: http://support.apple.com/kb/HT4859) -
If I wanted to change from I pad 2 to I pad mini is there any way Apple would do that trade off?
Your only option is to sell the iPad and buy a new one.
How to Sell Your Old iPad http://tinyurl.com/85d69lk
Other sources to sell.
eBay Instant Sell http://instantsale.ebay.com/?search=ipad
Sell and Recycle Used Electronics - Gazelle http://www.gazelle.com/
For instant gratification in selling a used iPhone or iPad, Gazelle’s Gadget Trader, an iOS app, is tough to beat. In seconds it detects the device and reveals how much it is worth in good condition. Tap the Sell This Phone to Gazelle button and the deed is done.
Sell Electronics for Cash - Next Worth http://www.nextworth.com/
Buy My Tronics http://www.buymytronics.com/
Sell Your iPad http://www.sellyourmac.com/mac-product-guides/ipad.html
Totem http://www.hellototem.com/
Cheers, Tom -
Is there any way to recover ePrinter account email by using a ePrinter e-mail address?
My problem is as follows, I registered my printer onto ePrintCenter and set custom email address to my printer. But, I logged out from the ePrintCenter and sine that time I couldn't login into the ePrintCenter any more as the system says that the e-mail address I set for ePrinterCenter is not used in the system.
So, I have my ePrinter e-mail, is there any way to recover ePrintCenter email address by using the printer email?
Thank you, Agrifert.Hi Agrifert,
Unfortunately its not possible to retrieve the email address you used to create your ePrintCenter account from the printer's ePrint email address. Are you still unable to log in to your ePrintCenter account? I'll wait to hear back from you before suggesting any further actions.
Best.
If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
I am an HP employee. -
HT4962 Are there any movies or tv shows that can be played with the Touch?
Are there any movies or tv shows that can be played with the ITouch? Attempted to download a tv show, however was advised it was not supported. Is there a way to configure the show to be played?
See:'
iTunes: Frequently asked questions about viewing and syncing videos
iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
There are third-party converters like the Free HandBrake program. -
I use firefox - Is there any way to make it so my internet browser only remembers the MAIN site? -- EG: Only Youtube.co.uk instead of Youtube.co.uk/VIDEO ect.ect. WHISPER PLEASE
Is this to reduce the clutter of suggestions on the address bar, or for some other reason?
You can change the address bar drop-down so it only suggest bookmarked sites instead of everything in your history. This article describes how to make that change: [[Awesome Bar - Find your bookmarks, history and tabs when you type in the address bar]] (see the section "How can I control what results the location bar shows me?").
Am I on the right track?
(I'm avoiding the really hard question of how to selectively cull your history. I can't think of a way to do that.) -
Is there any way an iPhone app developer can implement low power class 3 Bluetooth?
Is there any way an iPhone app developer can implement low power class 3 Bluetooth?
Ah-HA! I knew there had to be a way!
Not quite the same in 10.6, but close enough to find it:
It's iTunes>apps, not iTunes>iPhone>apps. I didn't realize there were different windows.
Not double-click, but control-click. Close enough.
Easy-Peasy, now that you showed me how.
Thanks, Barry.
--Gil -
Is there any way (or app) where I can change the qwerty keypad to the telephone textpad?
Hi! You can't do it without jailbraek. And I offer you "don't try it"!
-
I accidently cleared the push notifications on my i pad and now i want to see them back.is there any way to see them,because i have to see all the application what the notifications was for.it takes a lot of time.i am isking this to save my time in future
I found one other way to do it. I just deleted them all out of my iTunes library. Now I can re-import them from Window's My Music file with the original artists' names intact.
Thanks for your help, Matt! -
My home movie DVD folders all have red circle with white dash and won't allow the files to be read. Is there any way around this so I can back up the DVD's on a external HD?
Drag the folders to the external drive, and if prompted, click Authenticate. You'll probably be asked for an administrator password.
(116608) -
Is there any way to download these files manually from another source? The download from boot camp keeps stopping at around 25% and then produces the error "Can't download Windows Support Software because of a network problem". Thx!
No. This issue is dicussed here frequently. The only option is to be patient and try often. Search this forum for other posts about this issue.
-
Is there any way to make fade transitions in movies using quicktime pro 7?
is there any way to make fade transitions in movies using quicktime pro 7?
thanks. i eventually found your discussion trace from a few years ago on this shubject--after i posted my question. i do have i movies--another program to learn--which i guess does have the ability to do fade transitions. i'll figure it out....
vr
dr -
Is there any way for my phone NOT to be on silent on the lock screen?
Is there any way for my phone NOT to be on silent on the lock screen?
Make sure the Mute switch isn't enabled. If you see orange, it's in silent mode.
Maybe you are looking for
-
Install error 11gR2 on Windows 2008 Server R2
Hello, I have a question about an installation error I received on Windows 2008 Server R2 while trying to install the 11g R2 on an test machine. I had downloaded both cd's and extracted them and copied the first cd into an new directory and then trie
-
How to call system command to launch Windows Explorer
Hello, I'd like to open the windows explorer from java.... anyone know how this is done? thanks
-
Specular Highlight colour problem - Leica M8 RAW files
I have sent feedback to Apple regarding this problem. Use of the moire slider does not eliminate the coloured dots on bright specular highlights, for example sun reflecting off water droplets. By comparison, Capture One software produces bright white
-
Setting charset in HTML generated by Reports 6i
How can I define charset in html generated by Reports 6i. I need windows-1250 charset. Adding the following line in Before Report Value does not help. <meta http-equiv="content-type" content="text/html; charset=windows-1250"> Note: If I open that gen
-
Laptop to desktop transferring
Hiya, I take a lot of photos while on the road and like to upload them to my MacBook and then back up the whole library onto an external drive that I carry as well. And then when I'm home I transfer the images from my MacBook to my iMac, no problem.