Oracle index (function index, time-based daily)

Source: Internet
Author: User

 

No, too many builds will affect performance, and the maintenance cost will be high.

Generally, it is created on the keyword field.

For example, there are many fields after where, including the logtime field. You can create an index on this field,
The query filters out most records based on the specified time condition of the logtime field, and the rest will not be too many even if the full table is scanned, thus affecting the query speed.

Our services are basically created in the time type.Function IndexOf

For example
Create index emp_ind on EMP (to_char (hiredate, 'yyyy-mm-dd '))

Query time
Select * from EMP
Where (to_char (hiredate, 'yyyy-mm-dd') = '2017-01-25'

In this way, the remaining record is just a day's record, and other fields are used for filtering, which is fast.

Here is a time example.
P_o_w_cellsamplepoints 66.9 GB

Select * From p_o_w_cellsamplepoints
Where to_char ("starttime", 'yyyy-MM-DD ') = '2017-06-08'

Result less than 1 second

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.