accessandfilter
access:表示这个谓词条件的值将会影响数据的访问路径(表还是索引)。 filter:表示谓词条件的值并不会影响数据访问路径,只起到过滤的作用。 ----创建一张表echo----SQL create table echo as select * from dba_objects;Table created.SQL set autotrace trac
access:表示这个谓词条件的值将会影响数据的访问路径(表还是索引)。
filter:表示谓词条件的值并不会影响数据访问路径,只起到过滤的作用。
----创建一张表echo---- SQL> create table echo as select * from dba_objects; Table created. SQL> set autotrace trace exp; SQL> set linesize 150; SQL> select * from echo where object_id=1000; Execution Plan ---------------------------------------------------------- Plan hash value: 642657756 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 12 | 2484 | 289 (1)| 00:00:04 | |* 1 | TABLE ACCESS FULL| ECHO | 12 | 2484 | 289 (1)| 00:00:04 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("OBJECT_ID"=1000) ----因为表echo没有创建索引,执行计划没有选择数据访问路径的余地,谓词条件在这里只是起到数据过滤的作用,所以使用了filter。 Note ----- - dynamic sampling used for this statement (level=2) ----创建索引的情况---- SQL> create index echo_ind on echo(object_id); Index created. SQL> select * from echo where object_id=1000; Execution Plan ---------------------------------------------------------- Plan hash value: 1345159126 ---------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 207 | 2 (0)| 00:00:01 | | 1 | TABLE ACCESS BY INDEX ROWID| ECHO | 1 | 207 | 2 (0)| 00:00:01 | |* 2 | INDEX RANGE SCAN | ECHO_IND | 1 | | 1 (0)| 00:00:01 | ---------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("OBJECT_ID"=1000) ----谓词条件影响到数据访问的路径,选择了索引,所以用access。 Note ----- - dynamic sampling used for this statement (level=2)
关于access的谓词信息要格外注意,把自己当成优化器,要明白为什么谓词条件会这样影响访问路径。
没有索引就没有选择余地了,那谓词条件一定不会觉得访问路径,那只能是filter的了。对于filter,下面只有一个节点一般仅仅是起到过滤的作用,但是多余两
个节点基本上会涉及到被驱动表可能处于驱动表的循环中,一般可以通过改写sql的方式避免。

Outils d'IA chauds

Undresser.AI Undress
Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover
Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool
Images de déshabillage gratuites

Clothoff.io
Dissolvant de vêtements AI

AI Hentai Generator
Générez AI Hentai gratuitement.

Article chaud

Outils chauds

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Sujets chauds

Comment désactiver les applications en arrière-plan dans Windows 11_Tutoriel Windows 11 pour désactiver les applications en arrière-plan

Impossible d'autoriser l'accès à la caméra et au microphone sur iPhone

Comment lire le plan d'exécution de la procédure stockée Oracle

Comment le mécanisme de réflexion Java modifie-t-il le comportement d'une classe ?

Comment inter-domaines iframe dans vue
