الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

سؤال عن : سرعة تنفيذ أمر Delete

Featured Replies

بتاريخ:

عندي جدول به عدد سجلات كثيرة  نصف مليون ويأخذ وقت طويل اثناء تنفيذ أمر delete 

 

هل هناك فرق في سرعة تنفيذ هذا المثال .... ترتيب القيم داخل الاقواس 

delete from table where col in (100,20,50,40 ) ;

delete from table where col in ( 20 , 40,50,100 ) ;

وهل في اقتراح لتحسين سرعة حذف السجلات مع العلم انه يوجد فهرسهة على العمود وهذا العمود ليس مفتاح للجدول 

بتاريخ:
create table CHECK_INDEXES(
  Ind_Col       NUMBER PRIMARY KEY
);
/

begin
  for i in 1..10000 loop
    insert into check_indexes values(i);
  end loop;
end;
/

select * from check_indexes;
/

set autotrace on explain;

delete from check_indexes where ind_col in (100,20,50,40 ) ;
ROLLBACK;
delete from check_indexes where ind_col in ( 20 , 40,50,100 ) ;
ROLLBACK;

النتيجة 

delete from check_indexes where ind_col in (100,20,50,40 ) ;//

 
-------------------------------------------------------------------------------------
| Id  | Operation           | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------
|   0 | DELETE STATEMENT    |               |     1 |    13 |     1   (0)| 00:00:01 |
|   1 |  DELETE             | CHECK_INDEXES |       |       |            |          |
|   2 |   INLIST ITERATOR   |               |       |       |            |          |
|*  3 |    INDEX UNIQUE SCAN| SYS_C0011534  |     1 |    13 |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
 
   3 - access("IND_COL"=20 OR "IND_COL"=40 OR "IND_COL"=50 OR "IND_COL"=100)

//delete from check_indexes where ind_col in ( 20 , 40,50,100 ) ;
-------------------------------------------------------------------------------------
| Id  | Operation           | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------
|   0 | DELETE STATEMENT    |               |     1 |    13 |     1   (0)| 00:00:01 |
|   1 |  DELETE             | CHECK_INDEXES |       |       |            |          |
|   2 |   INLIST ITERATOR   |               |       |       |            |          |
|*  3 |    INDEX UNIQUE SCAN| SYS_C0011534  |     1 |    13 |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------------------
 

حسب النتائج متشابهة

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.