How stats impact query performance badly

Database
Highlighted
Enthusiast

How stats impact query performance badly

HI,

I have a query which was going out of spool and once i dropped few stats from a table it ran in a minute.In query i have joining on 

COSTCNTR_HIER_ID and where condition for "COSTCNTR_CODE" = 'NULL' 

Howcome droppping below improved the performance because COSTCNTR_CODE is in filter condition.All stats were refreshed prior to drop.

COLUMN  (COSTCNTR_CODE)

COLUMN  (COSTCNTR_CODE,COSTCNTR_LOB_HIER_CODE).

1 REPLY
Enthusiast

Re: How stats impact query performance badly

Hi,

 

This can happen if you add statistics to a table and they cause a change in the execution plan. As a result, the Optimizer may use now other statistics which are available on this table. If these statistics are stale, the execution plan can become bad.

 

Roland Wenzlofsky
Tags (1)