Indexes fragmentation level is very high after rebuild. Need help what is do for best database performance?
Database queries still running slow....
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 25, 2013, 8:00 PM EST
hi,
Data base query performance is very critical area.
Creating Index is not just upgrade database performance.
you have to study query(table) static base on this you have to change your query and join...
also study execution plan of your query...
Ravi ShekharRank #673 · 3.6K reputationPosted Nov 25, 2013, 8:13 PM EST
select sum(T.TQty)TQty,sum(T.SQty)SQty from
(
select count(OuterboxNo)as TQty,0 as SQty from wms_bulk_transaction where status='PUT' and concept='FL'
and slot_code in (select slot_code from wms_slot_master slt,wms_aielse_master ail where
slt.aielse_code=ail.aielse_code and ail.aielse_type='HR' and cyclecountnumber='CNT1300005')
union
select count(MonoboxNo)as TQty,0 as SQty from wms_loose_transaction where status='PUT' and concept='FL' and
slot_code in (select slot_code from wms_slot_master slt,wms_aielse_master ail where slt.aielse_code=ail.aielse_code and
(ail.aielse_type='SA' OR ail.aielse_type='MA') and cyclecountnumber='CNT1300005')
union
select 0 as TQty,count(OuterboxNo) as SQty from wms_bulk_transaction where status='PUT' and concept='FL' and
slot_code in (select slot_code from wms_slot_master slt,wms_aielse_master ail where slt.aielse_code=ail.aielse_code
and ail.aielse_type='HR' and cyclecountnumber='CNT1300005') and (cyclecountdone='CNT1300005' or cyclecountdone is not null)
union
select 0 as TQty,count(MonoboxNo) as SQty from wms_loose_transaction where status='PUT' and concept='FL' and
slot_code in (select slot_code from wms_slot_master slt,wms_aielse_master ail where slt.aielse_code=ail.aielse_code
and (ail.aielse_type='SA' OR ail.aielse_type='MA') and cyclecountnumber='CNT1300005') and (cyclecountdone='CNT1300005' or
cyclecountdone is not null)
)T
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 25, 2013, 8:20 PM EST
hi,
here you four query and you union to these query
first of all, check which query takes more time to execute?
Ravi ShekharRank #673 · 3.6K reputationPosted Nov 25, 2013, 8:32 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 25, 2013, 8:37 PM EST
SQL server execute these all queries individual and union to all queries and gave result.
just run and check all query which take more time all take more time....
for example
first run
select count(OuterboxNo)as TQty,0 as SQty from wms_bulk_transaction where status='PUT' and concept='FL'
and slot_code in (select slot_code from wms_slot_master slt,wms_aielse_master ail where
slt.aielse_code=ail.aielse_code and ail.aielse_type='HR' and cyclecountnumber='CNT1300005')
after other...