Sh M
asked on
sql server 2005
Hi,
I have got a SQL Query to improve it's performance.
Here is simple format of how it is structured:
Select x,y,z from table a
inner join table b on a.id = b.id
inner jon table c on b.id = c.id
inner join table d on a.id = d.id
left join table w.........
left join table y.........
left jon table z.........
left join table q.........
left join table p.........
how can this change to produce a faster query...
thanks in advance
I have got a SQL Query to improve it's performance.
Here is simple format of how it is structured:
Select x,y,z from table a
inner join table b on a.id = b.id
inner jon table c on b.id = c.id
inner join table d on a.id = d.id
left join table w.........
left join table y.........
left jon table z.........
left join table q.........
left join table p.........
how can this change to produce a faster query...
thanks in advance
The very first thing to check: do you have indexes on all of the columns used in joins and in your WHERE clause?If you are using a WHERE clause, what is it?
ASKER
Yes there is where clauses which is used for filtering basically
ASKER
for example
where a.x = @clientID
and b.y between @StartDate and @EndDate
where a.x = @clientID
and b.y between @StartDate and @EndDate
can you provide your real query?
(you may change table name/field list to something else to hide it real name, if u want to)
so we can see if some table can be remove or not
since now, we can't see which field need to be retrieve, which field need to be filter etc.
(you may change table name/field list to something else to hide it real name, if u want to)
so we can see if some table can be remove or not
since now, we can't see which field need to be retrieve, which field need to be filter etc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.