If you have 50 million of records then this solution is not feasible imho, that's why I am trying to split it.
On Aug 14, 4:34 pm, Stefan Steinegger <stefan.steineg...@bluewin.ch> wrote: > Why not simply: > > IList<string> result = session > .CreateQuery("select m.Text from Message where m.Read = false > and ...") > .List<string>(); > > and > > session.Update("Message set m.Read = false where ..."); > > You could also have a list of ids to know which messages need to be > set to read. > > On 14 Aug., 14:39, "empe...@gmail.com" <empe...@gmail.com> wrote: > > > In our domain model, we have a Message entity. Message entity is basic > > class with a simple string property and a status bool property if the > > message is "read" or not . The thing is we are expecting millions of > > messages and we would like to archive "read" messages. > > > So I thought I could make use of "entity-name" property to > > distinguish messages and "read" messages into to two different tables > > so that selecting unread messages will perform better. > > > But I am not sure how to manage it exactly, because a message can be > > transformed from read to unread if it is read. > > > So what do you recommend, entity-name is the way to go? should I use > > an interceptor to make unread messages read (thus returning a > > different entity name if message is read from interceptor) Will this > > move the row from one table to another ? > > > What other strategies you use for "big" tables ? > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---