File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes Facing performance problems. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Performance
Reply locked New topic
Author

Facing performance problems.

lokesh pattajoshi
Ranch Hand

Joined: Jul 29, 2009
Posts: 130
hi everybody i am using this(below) SQL query for searching some data but as i have used some joins and there are huge number of records it is giving me performance problem so can any body help me how can i optimize this query..every response is highly appreciated..

if i am searching a then this will be the query

select DISTINCT p.PolicyID "Policy ID", p.CustomerRef "Customer Reference", ct.Cover "Cover", p.Start_Date "Start Date", p.End_Date "End Date",p.No_of_Months "Term", p.DateCancelled "Cancelled Date"
from USER p inner join USER_TYPES ct on p.Cover = ct.CoverID, USER_AGENT sa
where sa.AgentID= p.AgentID and sa.BASE_CODE in ( 'ABC001' ) and ( p.PolicyID RLIKE '[[:<:]]a[[:>:]]' or p.Title RLIKE '[[:<:]]a[[:>:]]' or p.CustomerRef RLIKE '[[:<:]]a[[:>:]]' or p.Start_Date RLIKE '[[:<:]]a[[:>:]]' or p.End_Date RLIKE '[[:<:]]a[[:>:]]' order by 'Policy ID' limit ?,?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Please do not post the same question in more than one forum. Thanks.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
 
subject: Facing performance problems.
 
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture