Note that there are some explanatory texts on larger screens.

plurals
  1. POOracle - Index seems not to work. Still slow
    primarykey
    data
    text
    <p>Oracle Database: I have a table with 400000 rows. I create an index for field1. <strong>The following query is still very slow</strong> (700ms):</p> <pre><code>select field1, field2 from table where field1 = '0903400110106156' or field1 = '0903400110106160' or field1 = '0903400110106190' or field1 = '0903400110106471' or field1 = '0903400110106480' or field1 = '0903400110106494' or field1 = '0903500110100001' or field1 = '0903500110100012' or field1 = '0903500110100021' or field1 = '0903500110100031' or field1 = '0903500110100039' or field1 = '0903500110100047' or field1 = '0903500110100050' </code></pre> <p>I drop the index and I still get 700ms. I create the index again and I still get 700ms. What is wrong???</p> <p>The create index statement:</p> <pre><code>CREATE INDEX myindex ON table (field1) </code></pre> <p>EDIT: Explain Plan</p> <p>PLAN_TABLE_OUTPUT</p> <pre><code>----------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost | ----------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 4 | 60 | 2 | |* 1 | TABLE ACCESS FULL | table | 4 | 60 | 2 | ----------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("table"."field1"='0901690339400674') Note: cpu costing is off </code></pre> <p>EDIT2: OK, I did a table analysis for 2 tables. table1 has the speed problem. table2 is a lot faster (10msec instead of 700msec) although its size is similar to table1. Strange speed problem!!! Please help...</p> <pre><code>chk Owner Name Partition Subpartition Tablespace NumRows Blocks EmptyBlocks AvgSpace ChainCnt AvgRowLen AvgSpaceFLBlocks NumFLBlocks UserStats GlobalStats LastAnalyzed SampleSize Monitoring Status PartType PartInfo IsExternal TRUE user table1 tablespace 484627 6858 182 878 777 103 NO NO 15/3/2011 18:34 125977 NO Normal, Successful Completion FALSE TRUE user table2 tablespace 366159 6480 176 786 16565 130 NO NO 15/3/2011 18:34 89657 NO Normal, Successful Completion FALSE </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload