Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
devanshi
Starting Member
2 Posts |
Posted - 2011-12-15 : 03:35:19
|
I have a query that uses multiple left joins.I need to improve performance(The response time).I have created index on required tables.SELECT ROWNUM, log.a, TO_CHAR(log.b,'mm')AS MONTH, log.c, log.d, batch.e, batch.f, trx.g, trx.hFROM logLEFT JOIN batch ON log.id = batch.id AND log.bid = batch.bid AND SUBSTR(batch.RPDT_XMT_TY_CD,1,1) = 'I'LEFT JOIN trx ON log.id = trx.id AND SUBSTR(trx.RPDT_XMT_TY_CD,1,1) = 'I'WHERE log.id = transmID; |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-15 : 03:45:36
|
its because of SUBSTR expression in join condition. . it wont use index if at all it exists on fields used inside functiontry using like insteadAND batch.RPDT_XMT_TY_CD LIKE 'I%'..------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
devanshi
Starting Member
2 Posts |
Posted - 2011-12-16 : 04:22:03
|
There was no signiicant improvement by replacing substr with like.The explain plan remained same. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-16 : 06:30:54
|
quote: Originally posted by devanshi There was no signiicant improvement by replacing substr with like.The explain plan remained same.
is it using indexes present?also what are costly steps in execution plan?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|