+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

query taking long time from java code

  1. Re: query taking long time from java code

    palak123i@gmail.com wrote:
    > Hi,
    > Thanks for the reply. I will try this out. However I am not using
    > pagination. I am trying to get a product list from database which has
    > got 15+ million records. And the number of rows returned from the
    > search are only 5-10...
    > Thanks,
    > Palak.
    >


    Get the execution plans and find out the difference.
    If you show us the query and the indexes of the table(s) we may be able
    to help you.
    To get 5-10 rows out of ~15 million you must have a very selective index
    on that table. Is the data distribution for the first column of that
    index even or not?

    If you e.g. have a table with a column with an very uneven distribution
    oracle may choose a full table scan if you use host variables in your
    statement.
    You said you are using a prepared statement, so you probably do use host
    variables.
    Typing in the statement in toad with literals does not use host
    variables and can choose the execution plan based on the given values.

  2. Re: query taking long time from java code

    palak123i@gmail.com wrote:
    > Hi,
    > Thanks for the reply. I will try this out. However I am not using
    > pagination. I am trying to get a product list from database which has
    > got 15+ million records. And the number of rows returned from the
    > search are only 5-10...
    > Thanks,
    > Palak.
    >


    Get the execution plans and find out the difference.
    If you show us the query and the indexes of the table(s) we may be able
    to help you.
    To get 5-10 rows out of ~15 million you must have a very selective index
    on that table. Is the data distribution for the first column of that
    index even or not?

    If you e.g. have a table with a column with an very uneven distribution
    oracle may choose a full table scan if you use host variables in your
    statement.
    You said you are using a prepared statement, so you probably do use host
    variables.
    Typing in the statement in toad with literals does not use host
    variables and can choose the execution plan based on the given values.

  3. Re: query taking long time from java code

    palak123i@gmail.com wrote:
    > Hi,
    > Thanks for the reply. I will try this out. However I am not using
    > pagination. I am trying to get a product list from database which has
    > got 15+ million records. And the number of rows returned from the
    > search are only 5-10...
    > Thanks,
    > Palak.
    >


    Get the execution plans and find out the difference.
    If you show us the query and the indexes of the table(s) we may be able
    to help you.
    To get 5-10 rows out of ~15 million you must have a very selective index
    on that table. Is the data distribution for the first column of that
    index even or not?

    If you e.g. have a table with a column with an very uneven distribution
    oracle may choose a full table scan if you use host variables in your
    statement.
    You said you are using a prepared statement, so you probably do use host
    variables.
    Typing in the statement in toad with literals does not use host
    variables and can choose the execution plan based on the given values.

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2