Question : Sybase Isolation Level 0

I am trying to run a query on Sybase using isolation level 0 in the hope that it would be faster. However, it's actually much slower than running it on isolation 1.  

It says in the Sybase manual that an identity column is needed for tables with non unique index.  I created an identity column but it doesn't seem to help.

I would appreciate any help.

Answer : Sybase Isolation Level 0

Deadlocks can only come from two places:

1) internal Sybase ASE code
2) external SQL being submitted

If you have enabled "backwards scans" (via sp_configure) then disable it again. This is the only thing you can do about #1.

Do you have any control over #2? The classic deadlock scenario is where two different parts of an app access tables in different orders.

Isolation level 0 isn't really intended to resolve locking or deadlock problems; it's for when senior management need to know an answer Real Fast Now and are willing to get a somewhat fuzzy and inaccurate answer for the sake of getting it faster. Remember the results from dirty reads might just plain be wrong - definitely not an ongoign workaround for locking problems!

Fixing the SQL is really going to give you the best results, but if that isn't an option, then sure, DOL is the way to go.

There are *many* concerns about DOL - but they are all manageable. 8-)

When you switch a table to DOL:

- all response times on that table get slightly worse
- the table takes up more space immediately
- the table is now suddenly prone to a few fragmentation problems that can't affect APL tables, so you now need to include regular defragmentation in your DBA maintenance

About the only other thing I'd add is that I see you've gone straight to "datarows" locking. Did you try datapages first? Often that's enough to fix deadlocking problems (since most deadlocks are actually on indexes rather than on data). Try switching all tables involved to datapages, and if that isn't enough, switch one at a time to datarows. I prefer datapages because some of the overhead per above is reduced on them, and you don't need as many locks. (This is a little controversial, many Sybase experts don't agree with me on it.)
Random Solutions  
 
programming4us programming4us