Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Check Oracle installed products using one command Oracle
  • MYSQL and Oracle Comparison for Oracle DBA MYSQL
  • How to stop OCSSD Daemon Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • Jai Shree Ram Linux/Unix
  • SQLPLUS COPY command Precautions. Oracle
  • All About Trace Fils Oracle
  • crontab syntax Linux/Unix
  • Find All internal Parameters Oracle
  • EXTPROC Oracle
  • find_cons.sql Oracle
  • Nice Article about semaphores and init.ora Processes parameter relations Linux/Unix
  • to see when crontab is changed. Linux/Unix
  • upload.html PHP/MYSQL/Wordpress
  • Find_table_size.sql Oracle

How to choose Driver table in SQL statement

Posted on 20-Jul-2006 By Admin No Comments on How to choose Driver table in SQL statement

Driver table:

Take the driver table which returns the less number of rows for predicate with literal valae. For example,

Consider the statement below:

SELECT SUM(BIP.VALUE) value

FROM BSKT_ITEM_CALC_PRICING BIP,BSKT_PRICING_ELEMENT BP

WHERE BIP.BASKET_ITEM_ID IN (:”SYS_B_0″)

AND BIP.PRICING_ELEMENT_ID = BP.PRICING_ELEMENT_ID

AND BP.PRICING_TYPE_CODE = :1;

Here

SQL> select BASKET_ITEM_ID, count(1) from BSKT_ITEM_CALC_PRICING group by BASKET_ITEM_ID;

BASKET_ITEM_ID COUNT(1)

———————————— ———

0cb3d2ac-1752-11db-b16d-e7b30c1e0ad1 3

0cb4816e-17e4-11db-b16d-e7b30c1e0ad1 2

0cb4e921-17df-11db-b177-87592b92a6f6 1

0cb614dc-17f4-11db-b16d-e7b30c1e0ad1 3

0cb7df1e-17f3-11db-9334-ab56ed57951d 1

and

15:00:41 CS@WEBP18F:-> select PRICING_TYPE_CODE, count(1) from BSKT_PRICING_ELEMENT group by PRICING_TYPE_CODE;

PRICING_TYPE_CODE COUNT(1)

—————– ———

1 139283

2 45646

3 58404

4 104810

7 145377

11 98004

15 878

So table BSKT_ITEM_CALC_PRICING is candidate for driver table.

Oracle, SQL scripts

Post navigation

Previous Post: SQL_PLAN.sql for checking real execution plan
Next Post: Find average Row Length and other table size calculation. metalink notes

Related Posts

  • Export Oracle data and Compress at same time Oracle
  • Oracle 10g Wait Model Oracle
  • Oracle 10g Installation/Applying Patches Tips Oracle
  • How to find where datafile is created dbf_info.sql Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • Proc code Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (150)
  • MYSQL (5)
  • Oracle (403)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (151)
  • SQL scripts (349)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • ORA-3136 Oracle
  • Sending email with file attachment. Linux/Unix
  • top 10 AI news today Uncategorized
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • sql_doing_fts.sql Oracle
  • To see mem usage and CPU usage system wide. Linux/Unix
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme