And of course, this won't go into NH codebase, since it is really hacky! :)

On Tue, Dec 16, 2008 at 10:45 PM, Tuna Toksöz <[email protected]> wrote:

> Not directly related to NHibernate, but it am playing with mssql 2005
> dialect for nhibernate.
>
> As you know, in order to use paging, we have to move ORDER BY clauses into
> OVER (HERE) in order to get order numbers.
>
>
> My thinking is that instead of moving ORDER BY clause, I plan to use a
> structure similar to this
>
>
> select top 10 id_0_1, name_0_1 from (select row_number() over (order
> current_timestamp) as row,this_.id as id_0_1, this_.name_0_1 from table
> this_ order by this_.name)
>
> obviously this won't work as we can't nest a select clause if it has order
> by embedded, it says TOP clause is needed.
>
> i then tried
>
>
> "select top 10 id_0_1, name_0_1 from (select TOP " + long.MaxValue + "
> row_number() over (current_timestamp) as row,this_.id as id_0_1,
> this_.name_0_1 from table this_ order by this_.name) where row>30"
>
> The questions are:
>
> What happens if I add TOP VERYBIGINTEGER(long.MaxValue) in terms of
> performance, I don't think it really makes an effect, besides looking really
> ugly.
> What happens if order by current_timestamp? I heard that it's precision may
> not be enough accurate, but assuming this value is calculated row by row,
> some rows will share the same number, and some higher when the row number
> increases.
> What happens if I order by a constant parameter, in terms of performance
> again?
>
> Thank you all for your attention.
>
>
> --
> Tuna Toksöz
> http://tunatoksoz.com
>
> Typos included to enhance the readers attention!
>
>


-- 
Tuna Toksöz
http://tunatoksoz.com

Typos included to enhance the readers attention!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to