#11017: Oracle LIKEC query doesn't use index
---------------------------------------------------+------------------------
          Reporter:  jtiai                         |         Owner:  nobody
            Status:  new                           |     Milestone:  1.2   
         Component:  Database layer (models, ORM)  |       Version:  SVN   
        Resolution:                                |      Keywords:  oracle
             Stage:  Accepted                      |     Has_patch:  0     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by jtiai):

 Replying to [comment:8 ikelly]:
 > Thanks for the test case.  This confirms that the problem happens at
 least with VARCHAR2 columns.  However, when I change the column type to
 NVARCHAR2, I get full table scans for both queries.  I may have something
 misconfigured -- it seems bizarre that this sort of query would ignore the
 index just because the column is NVARCHAR2.

 Full table scan was chosen by oracle optimizer because there was too few
 rows. Change that most inner loop {{{for c in 1..100}}} to something like
 10000 and you start getting index usage with NVARCHAR2 too. Still it
 doesn't fix LIKEC problem...

 Of course I always can fallback to RAW SQL here.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11017#comment:10>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to