• Christian Buettner (1/23/2008)


    Hello Andras,

    could you please provide an example where TOP 1 speeds up the query?

    I was always under the assumption that SQL Server would automatically TOP the query when EXISTS is used.

    Thanks!

    Hmmm, I've just spent 10 minutest trying to reproduce this, and no luck :(. It was one of the smaller system tables I've checked before, and the difference was 1 logical read with TOP, 2 logical reads without. But I'm starting to doubt this now myself, having tried to reproduce this with tables ranging from 2 to 8 pages. Maybe to condition I used was more complex? With larger tables, as expected, the number of reads is the same.

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software