Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4600712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:43:23+00:00 2026-05-21T23:43:23+00:00

I came across this particular script which uses a special form of equi join.

  • 0

I came across this particular script which uses a special form of equi join.

SELECT * 
FROM 
per_assignments a, per_assigment_types b
WHERE
a.assignment_status_type_id + 0  = b.assignment_status_type_id

Why is the zero added in the equi join? I came to know that it has something to do with avoiding index search, but still can some one explain the complete picture of the same. Thanks in advance

Edit :

It’s not something which is related to the Table / Column declarations. As far as I know it’s something to do with SQL tuning.

This is what I found :-

  1. This is used in smaller tables.
  2. Instead of doing an index search as done normally, this would search the complete table in one go.

But I really don’t know exactly what’s the difference with a normal equi-join, moreover how indexing affects performance.

It would be really helpful if some one could describe within the particular context and also let me know if my findings are wrong. Appreciate your time and effort for the same 🙂

Column Description:

The assignment status type Id’s in both tables are declared as NUMBER(9)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:43:24+00:00Added an answer on May 21, 2026 at 11:43 pm

    The reason for killing the index use for small tables is performance. When you use an index to perform a join it takes two disk I/Os to read data. One to read the index, and a second to read the data from the full table. With smaller tables it is can be faster to read the whole table and perform a full table scan than to perform the second disk I/O.

    This is a broad generalization and may vary from time to time even in your database. In theory the SQL optimizer should be smart enough to recognize this condition and use the full table scan over an index lookup even without the hint. It also possible that if you add data to one or both tables, it moves the faster performance from full table scan to index lookup.

    The questions I have about tuning these queries would be:

    1. What are the precise definitions of the tables, including how full are VARCHAR columns (if any) on average?
    2. How many rows are in each table?
    3. How many rows are added to each table per day?
    4. How often is this query executed?
    5. Has anyone timed they query execution with both options to see which is faster?

    My concern would be this query was written as a clever performance enhancement, either for an earlier version of the database or simply as a clever hack without realizing the query optimizer may do as good or better job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across the following article which got me interested in this particular problem.
I am developing a personal PHP/MySQL app, and I came across this particular scenario
I recently came across some code like this: parent && parent.removeChild(this); Which takes the
I came across this Android WebView function WebSettings.setDomStorageEnabled(true) and from the name alone I
I'm trying to debug my first R script and I came across this line:
I came across this relatively old post which describes how impressively Nexus One's noise
Came across this error today. Wondering if anyone can tell me what it means:
I came across this simple PHP Class on GitHub while searching for Bloom Filters,
I came across this today MPI_ERR_COUNT Invalid count argument. Count arguments must be non-negative;
I came across this article written by Andrei Alexandrescu and Petru Marginean many years

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.