Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: Custom Pagination in SQL Server 2005

    peter (1/10/2009)


    My comments are focused on non-meaningful primary keys, which is what identity columns are. It is just a compact number (32 bit int in most cases) and contrary to...

  • RE: Custom Pagination in SQL Server 2005

    peter (1/10/2009)


    A primary key (identity or otherwise) cannot be used due to any sensible order by clause in the base query. Remember here that an order by on just the...

  • RE: Custom Pagination in SQL Server 2005

    Adam Haines (1/8/2009)


    ...First there should be some sort of filter in the first CTE. This way you can reduce the amount of data searched through...

    You are using CTE...

  • RE: Custom Pagination in SQL Server 2005

    Adam Haines (1/7/2009) ...Unfortunately, this still should yield a index scan. The case expression is still evaluated for every row, as the optimizer doesnt know if the variable matches...

  • RE: Custom Pagination in SQL Server 2005

    TheSQLGuru (1/7/2009)


    phystech (1/7/2009)


    TheSQLGuru (1/7/2009)

    ...If you never passed in a NULL value then the CASE is surperfluous, right?..

    No, zero length string plays the role of NULL. That is if...

  • RE: Custom Pagination in SQL Server 2005

    Adam Haines (1/7/2009)

    ...Can you confirm that the code you are posting actually generates index seeks?...

    I need a couple of days to prove/disprove it, right now I'm working on my...

  • RE: Custom Pagination in SQL Server 2005

    TheSQLGuru (1/7/2009)

    ...If you never passed in a NULL value then the CASE is surperfluous, right?..

    No, zero length string plays the role of NULL. That is if the parameter...

  • RE: Custom Pagination in SQL Server 2005

    TheSQLGuru (1/7/2009)


    phystech (1/6/2009)


    Adam Haines (1/6/2009)

    The optimizer knows that

    "CASE WHEN @FirstName IS NOT NULL THEN"

    can be evaluated before the query is launched, since no column name is involved here...

  • RE: Custom Pagination in SQL Server 2005

    Adam Haines (1/6/2009)

    WHERE CASE

    WHEN @FirstName IS NOT NULL THEN

    CASE WHEN FirstName = @FirstName THEN 1

    ...

  • RE: Custom Pagination in SQL Server 2005

    Adam Haines (1/6/2009)


    phystech (1/6/2009)


    What can we do to make this query index seek? Well, we really only have two options. One is to use dynamic sql to build...

  • RE: Custom Pagination in SQL Server 2005

    What can we do to make this query index seek? Well, we really only have two options. One is to use dynamic sql to build the predicate dynamically....

  • RE: If You Ain't Cheatin'

    John Magnabosco (8/25/2008)


    In regard to the last line of the editorial: "I have no idea how to change this in the world at large, other than more emphasis throughout society...

Viewing 12 posts - 1 through 12 (of 12 total)