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 6145835
In Process

The Archive Base Latest Questions

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

i am running a query in oracle 10 select A from B where C

  • 0

i am running a query in oracle 10 select A from B where C = D
B has millions of records and there is no index on C

The first time i run it it takes about 30 seconds, the second time i run the query it takes about 1 second.

Obviously it’s caching something and i want it to stop that, each time i run the query i want it to take 30s – just like it was running for the first time.

  • i am over-simplifying the issue that i am having for the sake of making the question readable.

Thanks

  • 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-23T18:51:21+00:00Added an answer on May 23, 2026 at 6:51 pm

    Clearing the caches to measure performance is possible but very unwieldy.

    A very good measure for tracking achieved performance of tuning efforts is counting the number of read blocks during query execution. One of the easiest way to do this is using sqlplus with autotrace, like so:

    set autotrace traceonly
    <your query>
    

    outputs

    ...
    Statistics
    ----------------------------------------------------------
              0  recursive calls
              0  db block gets
              1  consistent gets
              0  physical reads
              0  redo size
            363  bytes sent via SQL*Net to client
            364  bytes received via SQL*Net from client
              4  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    

    The number of blocks read, be it from cache or from disk, is consistent gets.

    Another way is running the query with increased statistics i.e. with the hint gather_plan_statistics and then looking at the query plan from the cursor cache:

    auto autotrace off
    set serveroutput off
    <your query with hint gather_plan_statistics>
    select * from table(dbms_xplan.display_cursor(null,null,'typical allstats'));
    

    The number of blocks read is output in column buffers.

    ---------------------------------------------------------------------------------------------------------------------
    | Id  | Operation        | Name           | Starts | E-Rows | Cost (%CPU)| E-Time   | A-Rows |   A-Time   | Buffers |
    ---------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |                |      3 |        |     1 (100)|          |      3 |00:00:00.01 |       3 |
    |   1 |  SORT AGGREGATE  |                |      3 |      1 |            |          |      3 |00:00:00.01 |       3 |
    |   2 |   INDEX FULL SCAN| ABCDEF         |      3 |    176 |     1   (0)| 00:00:01 |    528 |00:00:00.01 |       3 |
    ---------------------------------------------------------------------------------------------------------------------
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running this query on an Oracle DB: SELECT COUNT(1) FROM db.table WHERE columnA
I am running oracle and have a query which pulls some results from the
I am running a query that returns records from the LEFT of the EXCEPT
I'm running this query: SELECT TOP 1 [DVD Copy].[Stock No] FROM [DVD Copy] WHERE
I currently have the query running on Postgres: SELECT * FROM addenda.users WHERE users.username
I'm running a query that is timing out for first two times and returning
I am running an Oracle query. It seems to work except that it returns
I have this error when running a large query on oracle. any advice? I'm
I have the following query: SELECT wm_concat(DISTINCT NAME) as Methods FROM TPM_TRAININGPLAN JOIN TPM_DELIVERYMETHODS
Is there any way in Oracle within an SQL query to reference a column

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.