Search notes:

Oracle SQL Plan operation: HASH JOIN RIGHT SEMI

create table tq84_A (id   number, tx varchar2(3));
create table tq84_B (id_a number);

insert into tq84_A select level*37, 'X' from dual connect by level < 1000;
insert into tq84_B select level+91      from dual connect by level <  600;

begin
   dbms_stats.gather_table_stats(user, 'tq84_A');
   dbms_stats.gather_table_stats(user, 'tq84_B');
end;
/

explain plan for
select
   id,
   tx
from
   tq84_A
where
   id in (select id_a from tq84_B);

select * from table(dbms_xplan.display(format=>'basic'));
--
-- ---------------------------------------
-- | Id  | Operation            | Name   |
-- ---------------------------------------
-- |   0 | SELECT STATEMENT     |        |
-- |   1 |  HASH JOIN RIGHT SEMI|        |
-- |   2 |   TABLE ACCESS FULL  | TQ84_B |
-- |   3 |   TABLE ACCESS FULL  | TQ84_A |
-- ---------------------------------------

drop table tq84_A;
drop table tq84_B;

See also

Semi joins
Plan operations

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199313, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/statement/execution/plan/operations/hash-join/semi/right/index(71): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78