?
Solved

Db2 query too fast!!

Posted on 2003-03-09
6
Medium Priority
?
745 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

752 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