Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • Paste command syntax Linux/Unix
  • Good notes for shared pool Oracle
  • Good Doc 28-JUN-2006 Oracle
  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • how to find OS block size Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle
  • Goldengate document from Porus Oracle
  • Rownum with Order by Oracle
  • Example of How To Resize the Online Redo Logfiles Note:1035935.6 Oracle
  • Btee and Bitmap Plans in Oracle 9i and higher Oracle
  • online_ts_bkup.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

  • Oracle Data Direct to TAPE Oracle
  • arch_configUOCIOTTO.ora Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • RAC 11g with vmware Oracle
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle
  • exp syntax in oracle 10g 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 (149)
  • MYSQL (5)
  • Oracle (395)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • 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

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Debugging Shell FIles Linux/Unix
  • Renaming Oracle Instance Name Oracle
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • My Minimum Tuning Programs Oracle
  • Oracle Connections expire_time and firewall Oracle
  • Read CSV File using Python Python/PySpark
  • find_longsql.sql Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme