Using 'identity' or similar will still disable INSERT batching. Using
hilo or pooled will give you integer identifiers and allow batching.

/Oskar


2012/11/28 costa <[email protected]>:
> @Gunnar Liljas: If you are joking ignore my message. If you are not joking
> this is the query that gets executed by NH when a new record is inserted in
> a table with an identity(1, 1) field:
>
>     INSERT
>     INTO
>         [
>         dbo].[DataType] (
>             [Name]
>         )
>     VALUES
>         (@p0);
>     select
>         SCOPE_IDENTITY();
>
> Note the select SCOPE_IDENTITY(); statement that's returning the new id in
> the same database call. Yes, it's an additional statement to get it but it's
> embedded in the same call and it should be very fast to get that value.
>
> As Sam pointed out, there is a price to pay for using GUIDS. I actually have
> done performance tests because I had an idiot at work that started to use
> them everywhere, and the performance starts to degrade pretty soon. They are
> also ugly when you write and run queries.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nhusers/-/FtEb2VQpsYYJ.
>
> 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.

-- 
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