How to use Hash partition to optimize Oracle analysis functions (1)

Source: Internet
Author: User

Principle: When the hash partition field of the data table is consistent with the partition by field in the analysis function, the data on each partition can be operated independently without interference. Therefore, the efficiency of Oracle analysis functions can be improved quickly. The test procedure is as follows:

Step 1: Create a partition table and a common table with the same structure as DBA_OBJECTS:

 
 
  1. create table t_partition_hash(  
  2. object_name varchar2(128),  
  3. subobject_name varchar2(30),  
  4. object_id number,  
  5. data_object_id number,  
  6. object_type varchar2(19),  
  7. created date,  
  8. last_ddl_time date,  
  9. timestamp varchar2(19),  
  10. status varchar2(7),  
  11. temporary varchar2(1),  
  12. generated varchar2(1),  
  13. secondary varchar2(1)  
  14. )  
  15. partition by hash(object_type)(  
  16. partition t_hash_p1 tablespace USERS,  
  17. partition t_hash_p2 tablespace USERS,  
  18. partition t_hash_p3 tablespace USERS,  
  19. partition t_hash_p4 tablespace USERS,  
  20. partition t_hash_p5 tablespace USERS,  
  21. partition t_hash_p6 tablespace USERS,  
  22. partition t_hash_p7 tablespace USERS,  
  23. partition t_hash_p8 tablespace USERS  
  24. );  
  25. create table t_big_hash(  
  26. object_name varchar2(128),  
  27. subobject_name varchar2(30),  
  28. object_id number,  
  29. data_object_id number,  
  30. object_type varchar2(19),  
  31. created date,  
  32. last_ddl_time date,  
  33. timestamp varchar2(19),  
  34. status varchar2(7),  
  35. temporary varchar2(1),  
  36. generated varchar2(1),  
  37. secondary varchar2(1)  
  38. );  
  39.  


Related Article

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.