> This code results in two database hits like so:
>
> I, [2007-11-16T13:15:11.468035 #1255]  INFO -- : INSERT INTO orders
> ( `market`, `date`, `order_id`) VALUES ( 'ICE', '20071114', '9104')
> I, [2007-11-16T13:15:11.468913 #1255]  INFO -- : SELECT * FROM orders
> WHERE (`id` = 28838) LIMIT 1
>
> The order instance obviously already knows the primary key since it
> uses it for the SELECT statement.

Currently when you create a model record, it is SELECTed immediately
after being INSERTed, in order to retrieve all the columns and any
default values belonging to the model instance. I think this makes
sense in many cases, but there's the performance penalty. If it's
really important to you, I can look at offering an alternative
behavior.

sharon

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to