Re: Python 2: unicode vs str param causing slowness

Vladimir Ryabtsev <[email protected]> Wed, 21 Jan 2015 00:42:29 +0300
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAMqTPqmpLuwZq3fN4F92cwiTK2y7rah3rm6ZTSwcXi0Y1=nQ7w@mail.gmail.com>
Hi,
Did you try to look the text of actual query that being executed when you
come across the slowness?
Something like this:
http://stackoverflow.com/questions/55899/how-to-see-the-actual-oracle-sql-statement-that-is-being-executed
You can also find out the datatype of your bound variable :platform as
mentioned here:
http://stackoverflow.com/questions/1707291/how-to-get-the-last-executed-sql-statement-and-bind-variable-values-in-oracle
This will you give a clue about implicit datatype conversion.
I don't think it's a django thing.

2015-01-20 21:05 GMT+03:00 Dayton Gomez <Dayton_Gomez-okLH5SSHHyRWk0Htik3J/[email protected]>:

> Yea, I think you're right. There's some implicit type conversion.
>
> Sadly, flipping the WHERE clause didn't change the outcome.
> --
>
>
> On 1/20/15 10:39 AM, "Doug Henderson" <[email protected]> wrote:
>
> >On 20 January 2015 at 08:55, Dayton Gomez <Dayton_Gomez-okLH5SSHHyRWk0Htik3J/[email protected]>
> >wrote:
> >>
> >> 100 seconds:
> >> cursor.execute('''SELECT COUNT(*) FROM "device" WHERE "PLATFORM" =
> >> :platform''', {'platform': u'ios'})
> >>
> >> .1 seconds:
> >> cursor.execute('''SELECT COUNT(*) FROM "device" WHERE "PLATFORM" =
> >> :platform''', {'platform': 'ios'})
> >
> >This sounds similar to problems where the indexed column is implicitly
> >type converted to match the bind variable's type.
> >
> >To test this, in 11g, if possible, rewrite the query as:
> >
> >cursor.execute('''SELECT COUNT(*) FROM "device" WHERE :platform =
> >"PLATFORM"''', {'platform': u'ios'})
> >
> >Doug
> >
> >--
> >Doug Henderson, Calgary, Alberta, Canada
> >
> >--------------------------------------------------------------------------
> >----
> >New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> >GigeNET is offering a free month of service with a new server in Ashburn.
> >Choose from 2 high performing configs, both with 100TB of bandwidth.
> >Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> >http://p.sf.net/sfu/gigenet
> >_______________________________________________
> >cx-oracle-users mailing list
> >cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> >https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
>
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> cx-oracle-users mailing list
> cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users