Syb15 Query takes longer, help me out

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Syb15 Query takes longer, help me out
# 1  
Old 01-19-2010
Syb15 Query takes longer, help me out

When i run the below query in syb15 (with syb 12.5.X backward compatibilty) environment it runs 45min where as the same in syb12.5.1 it takes only 7-10min.
But the main thing is stld_date(in the below query) does not covered in the index of that table. Also main_table is a huge table. So is it because of index for that column? . Can any one please provide ur suggestion to
change the query so i can get the response very fast like 7-10min but witout creating index we have to get the quciker result.
Even i tried the SET FORCEPLAN ON option but not worked out.

Code:
select
co1,col2, col3,
col4, col5, col6,
col7, col8,col9
col10,col11,col12,col13,col14,col15,col16
from acct_table b(index idx_acct),
main_table m(index idx_main)
where b.acctno=m.acctno
and b.acctno like '00%'
and b.stld_date >= @curnt_date
and b.stld_date <= @end_date
--------------------------------------------------
whereas @curnt_date = current date
@end_date = current date + 8 days
acct_table has only acct nos(acct starts with 00 and 11 but we need only 00)


Last edited by Scott; 01-19-2010 at 05:13 PM.. Reason: When using code, please use code tags
# 2  
Old 01-19-2010
Double post. Continued here.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Oracle simple SQL query result in: ORA-08103: object no longer exists

Dear community, please help with a query on Oracle. I'm using SQLPlus (but with SQLDeveloper is the same) to accamplish a sinple query like: select count(*) from ARCHIT_D_TB where (TYP_ID=22 OR TYP_ID=23) and SUB_TM like '%SEP%' and CONS=1234This is a very simple query that works perfect until... (5 Replies)
Discussion started by: Lord Spectre
5 Replies

2. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

3. Shell Programming and Scripting

Need help to run sql query from a script..which takes input from a file

I need to run sql script from shell script which takes the input from a file and contents of file will be like : 12345 34567 78657 and query will be like : select seq_nbr from bus_event where event_nbr='12345'; select seq_nbr from bus_event where event_nbr='34567'; select seq_nbr... (1 Reply)
Discussion started by: rkrish
1 Replies

4. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

5. Programming

select() system call takes longer than the timeout specified

Below is my code. Every once in a while the select call takes as long as 150 seconds (discovered by printing time before and after this statement) while the timeout specified into it is only 1 second. Any clue why? I can't believe that select call which has been around for centuries can have a bug,... (15 Replies)
Discussion started by: old_as_a_fossil
15 Replies

6. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

7. UNIX for Dummies Questions & Answers

Please help me out reg syb15 query

When i run the below query in syb15 (with syb 12.5.X backward compatibilty) environment it runs 45min where as the same in syb12.5.1 it takes only 7-10min. But the main thing is stld_date(in the below query) does not covered in the index of that table. Also main_table is a huge table. So is it... (0 Replies)
Discussion started by: prsam
0 Replies

8. Shell Programming and Scripting

add the output of a query to a variable to be used in another query

I would like to use the result of a query in another query. How do I redirect/add the output to another variable? $result = odbc_exec($connect, $query); while ($row = odbc_fetch_array($result)) { echo $row,"\n"; } odbc_close($connect); ?> This will output hostnames: host1... (0 Replies)
Discussion started by: hazno
0 Replies

9. UNIX for Advanced & Expert Users

Login Process takes longer

Hello. Since Yesterday, I notice that after giving telnet IP or SSH IP - it takes long time to display login: , I mean earlier after entering Server name It used to immediately ask for login ID and then password. But, now it takes min of 2-3 minute to ask for password. Where can I check,... (12 Replies)
Discussion started by: panchpan
12 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Can no longer login.

I registered last week, received the emails and activated my account. It worked splendidly. Today, I logged in, performed a search, then was prompted to login each time I moved to the next page in the search results. I requested and received a new password but UNIX.com thanks me for logging... (0 Replies)
Discussion started by: thebigm
0 Replies
Login or Register to Ask a Question