Viewing 15 posts - 16 through 30 (of 219 total)
Please post the DDL and PLAN of the query. Does your query have sarg for some of these columns and joins on other columns or maybe sarg on almost all...
July 9, 2012 at 12:20 pm
--see the results yourself..Intersect will perform better then other two and if proper indexes will be there the diff will be huge.
Intersect perform badly in Dwain's test because he has...
July 9, 2012 at 8:25 am
Do not use the method posted by me.That was wrong..Below one is correct..
Try all 3 methods for your query and see which one is the best.If there is clustred index...
July 9, 2012 at 8:00 am
You have to change that query..I just used a table a.Change it as per your requirement... like a will be your table name,id will be ordno and cd will be...
July 9, 2012 at 4:57 am
Gullimeel (7/9/2012)
--------------------------------------------------------------------------------
Try something like this.
--change the id with ordno and cd with product code
select * from
(
select id,
max(case when cd = 'A' then 1 else 0 end) +
max(case when...
July 9, 2012 at 4:45 am
Try something like this.
select count(ordno) from
(
select OrdNo,
sum(distinct(case when ItemNo = 'A' then 1 when ItemNo = 'B' then 2 when ItemNo = 'C' then 4 end)) as status
from OrdLine
where...
July 9, 2012 at 3:52 am
Post the plan of your query and ddl for tables.People might be able to help u on getting your query optimized..
July 7, 2012 at 11:30 pm
rCTE is a kind of loop.If this loop works with set of data and very few loops(recursion) results are good.but if it does row by row it wont be so...
July 7, 2012 at 1:02 pm
Try below..Modify it as per your need.
;WITH Abstraction(pYear, pMonth, pValue, jan,feb,mar,april,may,june,july,aug,sep,oct,nov,decb) AS
(
SELECT 1999
,12
,cast (0 as float)
,cast (0 as float)
,cast (null as float)
,cast (null as float)
,cast (null as float)
,cast (null as...
July 7, 2012 at 12:45 pm
If I find that my Index does have a Low Average Page Density,
Can I avoid this by using a Higher Fill Factor when/if I rebuild?
Are you using fillfactor for your...
July 7, 2012 at 12:08 pm
You have view in the query so it is not possible to create the indexed view.Also, indexes views are dynamic and are refreshed automatically.But it has many more restriction.
For more...
July 7, 2012 at 11:56 am
Personally, i think people consider just the avg fragmentation counter to decide whether to rebuild the indexes or not.I think using this counter alone is a bad idea.It mainly impcats...
July 7, 2012 at 11:47 am
There is a DML trigger defined on the table.
Can you please let me know if this in actually cause delete/insert for updarte? I couldnt see this behaviour.
July 7, 2012 at 11:38 am
Only way to do it is manually.Unless these tables are from same linked server and have some relationship.Even then you might have to check it manually because sometimes joins...
July 7, 2012 at 12:22 am
For perforamnce issue you need to give the showplan,ddl and others details.Please see in my signature how to post the perf issue.
July 7, 2012 at 12:15 am
Viewing 15 posts - 16 through 30 (of 219 total)