PL/SQL Programming (iii) package and package body, triggers, views, indexes

Source: Internet
Author: User

Conn Scott/tiger;grant insert,update,delete on EMP to System;conn system/orcl1234;create or replace VIEW V_empas select em Pno,ename,job,hiredate,deptno from Scott.emp;

Index

In order to improve the speed of the query, when the user is not satisfied with the query speed and needs to adjust the performance of the database, it is preferred to establish an index.
CREATE INDEX idx_ename on employee (ename, Sal DESC);

Proper use of indexes can improve the speed of data retrieval and can create indexes on fields that frequently require queries.

When you add rows to a table or delete rows from a table, you must spend extra time updating the index of the table, so when you need to retrieve a few rows from a large table, you create the index. Generally we think indexes are useful when any single query is to retrieve rows that are less than 10% of the total row count of the entire table.

The table's primary key and unique key will automatically create the index.

PL/SQL Programming (iii) package and package body, triggers, views, indexes

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.