Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • dbinv.sql Oracle
  • v$backup.status information Oracle
  • Roles and Stored Object behaviour Oracle
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • find_open_cur.sql Find open cursorts per session Oracle
  • checking redhat linux version Linux/Unix
  • Temporary Tablespace Information and restriction. Oracle
  • Move WordPress site from one hosting service to other. PHP/MYSQL/Wordpress
  • How to analyze statspack or AWR report. Oracle
  • Identical Dblink Issue… Oracle
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle
  • Kernel Parameter setting explaination for Processes Parameter Linux/Unix
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • Difference between SYNC and AFFIRM Oracle
  • Optimizer SORT Operations 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

  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • Oracle 11g RAC on OEL 5 and Vmware 2 Oracle
  • Jai Shree Ram Oracle
  • How to find password change date for user Oracle
  • Generating XML from SQLPLUS Oracle
  • executing Function from SQLPLUS prompt Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • 10g oem configuration Oracle
  • Add new columns in dataframe Python/PySpark
  • get_vmstat.ksh Linux/Unix
  • configUOCIOTTO.ora Oracle
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • plan10g.sql good1 Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme