Re: [cx-oracle-users] binding datetime in query
Brought to you by:
atuining
From: Rizzuto, R. <Ray...@si...> - 2011-02-18 14:18:09
|
I did that test, and the to_date() on a string was no faster than passing the native datetime object. I'm quite glad that the information I was given was incorrect, and cx_Oracle is working as expected. -----Original Message----- From: Mark Harrison [mailto:mh...@pi...] Sent: Monday, February 14, 2011 3:41 PM To: cx-...@li... Subject: Re: [cx-oracle-users] binding datetime in query On 2/14/11 12:32 PM, Rizzuto, Raymond wrote: > I suspect the issue may be that Oracle is converting the Date column to a datetime, and comparing each row with the datetime I passed in the bound variable. > > I tried to use datetime().date(), but cxOracle seems to still convert that to a datetime. what happens if you use to_date() in your query string, and pass in the parameter as a string? This will confirm that the execution plan is indeed using a date type, and you can see if the optimizer is still skipping over the index on the date column. if so, then there's some db or query tuning that needs to be done; if not, the problem is verified to be one of date conversion on the client side. hth! IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. |