?
Solved

Db2 query too fast!!

Posted on 2003-03-09
6
Medium Priority
?
771 Views
Last Modified: 2008-02-26
I need a db2 select query that takes a lot of time to execute. Any ideas on bad practices in db2 that will cause the database to really kill itself (in the order of minutes). I have a million records in 1 table which is refrenced in 3 different tables.

I know like's take time. Also not's. What about group by's and sort's etc etc etc.

Help!! Anything you did to speed up your db2 select query tell me so I can do the opposite.
0
Comment
Question by:John_Doe3rd
6 Comments
 
LVL 8

Expert Comment

by:Danielzt
ID: 8099701
can you put your SQL here?
0
 

Author Comment

by:John_Doe3rd
ID: 8099736
I have no idea what SQL to write. I will create my sql query once I know what is really takes time to execute. Right now im quite open to writing any sql which takes a lot of time. I know this isn't exactly a really precise question, but im just looking for in general stuff that will slow down a query to a point where it will take minutes on a query.

This is db2 running on a 1GHz with 1GB RAM. Just imagine how absurd a question this is.
0
 
LVL 9

Accepted Solution

by:
ornicar earned 300 total points
ID: 8099776
What about:

select * from MyTable A, MyTable B
where A.Column1 like concat("*",B.Column1)

Maybe not dirty enough but it is a starting point.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Expert Comment

by:jpkemp
ID: 8100669
LOL ornicar i love it.

To be even worse, add a few more *'s to the select list ("select *,*,*,* from..."). He he.

Jeff
0
 
LVL 9

Expert Comment

by:ornicar
ID: 8101737
Good idea!

I thought about adding some weird order by:

select *,*,*,*,* from MyTable A, MyTable B
where A.Column1 like concat("*",B.Column1)
order by right(A.Column1,length(A.Column1) - 1)

Should keep the computer busy for a while.
0
 

Author Comment

by:John_Doe3rd
ID: 8137186
(Y)

Thanks.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question