![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello Experts, I am working on an enterprise application and facing some issue while working on DB queries. I have a table - TABLE1 (having total 5 million rows) col1, col2, col3, col4, col5, col6, col7, col8, col9, col10 I have another table - TABLE2 (having total only 1000 rows) col1, col4, col6 TABLE2 contains redundent information for col1, col4, and col6 from TABLE1 I run the query as below for 16000 times for different values of col4 in where clause- select col1, col4, col6 from TABLE1 where col4='SOMEVALUE' This finish in few milliseconds I run the following query for 16000 times for different values of col4 in where clause select col1, col4, col6 from TABLE2 where col4='SOMEVALUE' Even though TABLE2 is a very small table as compared to TABLE1, this time these 16000 queries takes around 2 seconds. Almost 5-6 times more than that of the query for TABLE1. TABLE1 and TABLE2 are indexed on col1. Can you please suggest what parameters I should be looking for to understand and fix this. Thanks in advance for your help. |
#3
| |||
| |||
|
|
Hello Experts, I am working on an enterprise application and facing some issue while working on DB queries. I have a table - TABLE1 (having total 5 million rows) col1, col2, col3, col4, col5, col6, col7, col8, col9, col10 I have another table - TABLE2 (having total only 1000 rows) col1, col4, col6 TABLE2 contains redundent information for col1, col4, and col6 from TABLE1 I run the query as below for 16000 times for different values of col4 in where clause- select col1, col4, col6 from TABLE1 where col4='SOMEVALUE' This finish in few milliseconds I run the following query for 16000 times for different values of col4 in where clause select col1, col4, col6 from TABLE2 where col4='SOMEVALUE' Even though TABLE2 is a very small table as compared to TABLE1, this time these 16000 queries takes around 2 seconds. Almost 5-6 times more than that of the query for TABLE1. TABLE1 and TABLE2 are indexed on col1. Can you please suggest what parameters I should be looking for to understand and fix this. Thanks in advance for your help. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
MadhavC: # I run the query as below for 16000 times for different values of col4 in where clause- Don't do that ... don't run any query 16000 times ... use SQL and join things together so that you run the query once. Give Oracle as much work as is needed to be done in as few statements as possible ... |
|
I have another table - TABLE2 (having total only 1000 rows) col1, col4, col6 ... I run the following query for 16000 times for different values of col4 in where clause select col1, col4, col6 from TABLE2 where col4='SOMEVALUE' |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
The 16000 times query is not at the same time.These queries are fired as and when the application passes through this area of the code. I am gathering the cumulative timings for these queries. |
#8
| |||
| |||
|
|
Hello Experts, I am working on an enterprise application and facing some issue while working on DB queries. I have a table - TABLE1 (having total 5 million rows) col1, col2, col3, col4, col5, col6, col7, col8, col9, col10 I have another table - TABLE2 (having total only 1000 rows) col1, col4, col6 TABLE2 contains redundent information for col1, col4, and col6 from TABLE1 I run the query as below for 16000 times for different values of col4 in where clause- select col1, col4, col6 from TABLE1 where col4='SOMEVALUE' This finish in few milliseconds I run the following query for 16000 times for different values of col4 in where clause select col1, col4, col6 from TABLE2 where col4='SOMEVALUE' Even though TABLE2 is a very small table as compared to TABLE1, this time these 16000 queries takes around 2 seconds. Almost 5-6 times more than that of the query for TABLE1. TABLE1 and TABLE2 are indexed on col1. Can you please suggest what parameters I should be looking for to understand and fix this. Thanks in advance for your help. |
#9
| |||
| |||
|
|
Hello Experts, |
#10
| |||
| |||
|
|
I run the query as below for 16000 times for different values of col4 in where clause- select col1, col4, col6 from TABLE1 where col4='SOMEVALUE' This finish in few milliseconds I run the following query for 16000 times for different values of col4 in where clause select col1, col4, col6 from TABLE2 where col4='SOMEVALUE' TABLE1 and TABLE2 are indexed on col1. |
![]() |
| Thread Tools | |
| Display Modes | |
| |