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

  • SEARCH
  • Home
  • 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 450001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:49:32+00:00 2026-05-12T21:49:32+00:00

could anyone tell me if it makes a difference to Oracle 10g whether I

  • 0

could anyone tell me if it makes a difference to Oracle 10g whether I use:

SELECT col1 FROM myTable WHERE col2 = 'someval' AND col3 = "someotherval"

or

SELECT col1 FROM
    SELECT col1, col2, col3 FROM (
        SELECT * FROM myTable
    ) WHERE col2 = 'someval'
) WHERE col3 = "someotherval"

According to the explain plan, the cost for the above is the same, but Im a blank when it comes to performance measurement.

Background is: in my application, I have several basic queries that I need to modify by arbitrary criteria at runtime to provide datasets for different clients. The WHERE conditions and fetched columns are specific to a client configuration file and some configs may require looking in col2 while others look in col5 and so on. In addition, users may add additional criteria and columns on top of the client configuration. I was thinking of using a set of decorators to achieve this, so if the above is the same performance wise, I could keep all three query parts cleanly separated.

It’s an Oracle 10g. There is some hundred thousand rows in the table (actually it is a View).

Thanks for any suggestions.

  • 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-12T21:49:32+00:00Added an answer on May 12, 2026 at 9:49 pm

    In general Oracle’s Cost Based Optimizer will merge queries containing views (or in-line views in your case, which is essentially the same thing) as part of the query transformation phase of the optimisation.

    This is known as “view merging”, and will transform your second query into the first query. In some cases full view merging cannot be performed but even then “predicate pushing” might be allowed and performance will improve as a result.

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm#i37745

    also see:

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm#i37745
    http://www.oracle.com/pls/db102/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14200%2Fsql_elements006.htm%23SQLRF50908
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams142.htm#REFRN10141
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements006.htm#SQLRF50706

    Long story short, you should not have a problem here.

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

Sidebar

Related Questions

No related questions found

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.