当前位置:网站首页>How can I index the Oracle database field date?

How can I index the Oracle database field date?

2022-07-27 04:37:00 lovely girl

Oracle Database fields date How can I go to the index ?



Other answers 1:

Other answers 2:

Write conditions normally , Do not format the indexed date field before querying , such as

  
where to_char( Date fields ,'yyyymmdd') ='20220720';-- Don't walk index where Date fields =date'2022-07-20' -- Go to the index where Date fields >=date'2022-07-20' and Date fields <date'2022-07-21' -- Walking range index where Date fields =trunc(sysdate) -- Go to the index

Other answers 3:
  1. to_date The format is different , It affects whether the query is indexed
  2. The data volume is in the 10% above , It is possible to scan the whole table , Instead of walking .
  3. Type the field , Don't go by index

Borrow your question , Did a little test , I hope it helped you ,
Address :https://www.modb.pro/db/442050

原网站

版权声明
本文为[lovely girl]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207201254155576.html