Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • RAC 11g with vmware Oracle
  • Check Oracle installed products using one command Oracle
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • Sort with ASCII order and Numeric Order Linux/Unix
  • How to check current redo log progress redo_progress.sql Oracle
  • CTAS with LONG Column for 7.x and 8 and 8i Oracle
  • Small sample shell program Linux/Unix
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • Nice Article about semaphores and init.ora Processes parameter relations Linux/Unix
  • normal maintenance for exp-imp and renaming table Oracle
  • findobj.sql Oracle
  • Rename Tablespace Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • arch_configUOCIOTTO.ora Oracle
  • proper cpu stats Linux/Unix

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

  • Optimizer SORT Operations Oracle
  • Drop tempfiles from database Oracle
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • The most important Tuning Notes Oracle
  • Clean up Oracle
  • Roles and Stored Procs II 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
  • AWR license Oracle
  • Find all users who have DML privileges Oracle
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • TRUNCATE table and disabling referential constraints. Oracle
  • Oracle Release Explaination Oracle
  • temp_use.sql diplays usage of temp ts Oracle
  • Default User Profile Oracle
  • Trace a SQL session from another session using ORADEBUG Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme