Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Search and replace editor command in vi Linux/Unix
  • Find All internal Parameters Oracle
  • Oracle Support Metalink ID 161818.1 Oracle
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • checking redhat linux version Linux/Unix
  • Sample WW22 listener.ora Oracle
  • Reclaim temp tablespace for oracle 8, 8i Oracle
  • xargs use Linux/Unix
  • Order by with ROWNUM Oracle
  • v$backup.status information Oracle
  • crontab syntax Linux/Unix
  • Oracle 11g Environment Setup Oracle
  • How to analyze statspack or AWR report. Oracle
  • scripts to take listener.log backup Linux/Unix
  • How to find Unix server conguraiton including Server Model number and underlying disk sub-system ( On Solaris) 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

  • Oracle Connections expire_time and firewall Oracle
  • Committing distributed transaction using commit force Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • plan10g.sql Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • My Minimum Tuning Programs Oracle

Leave a Reply Cancel reply

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

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Wait.sql Oracle
  • Ports used by Oracle Software Oracle
  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • Difference between SYNC and AFFIRM Oracle
  • DBMS_UTILITY PACKAGE Oracle
  • Resolving RMAN Hung Jobs Oracle
  • Kernel Parameter setting explaination for Processes Parameter Linux/Unix
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme