Bookmark Topic Watch Topic
  • New Topic

Facing performance problems.

 
lokesh pattajoshi
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question in more than one forum. Thanks.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!