Re: [GENERAL] Partial Index Too Literal?

2008-06-27 Thread Phillip Mills
That example also reports that it uses the index. Only the "is true" variation insists on seq. scan. On Thu, Jun 26, 2008 at 4:08 PM, Lennin Caro <[EMAIL PROTECTED]> wrote: > use this > > explain analyze select * from result where active = 't'; > > --

[GENERAL] Partial Index Too Literal?

2008-06-26 Thread Phillip Mills
Under somewhat unusual circumstances, rows in one of our tables have an 'active' flag with a true value. We check for these relatively often since they represent cases that need special handling. We've found through testing that having a partial index on that field works well. What seems odd to

Re: [GENERAL] Serialized Access

2008-06-26 Thread Phillip Mills
On Wed, Jun 25, 2008 at 10:21 PM, Craig Ringer <[EMAIL PROTECTED]> wrote: > > You might want to look into advisory locking. If your locks don't need > to be longer than the life of an active EntityManager session then you > can probably just issue a native query through the EntityManager to > acqu

Re: [GENERAL] Serialized Access

2008-06-26 Thread Phillip Mills
On Wed, Jun 25, 2008 at 10:55 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > Until you benchmark it for your app you really don't know how > inefficient it really is compared to pessimistic locking. > Sure. The question was about more about finding the right approach/layer for implementing pessi

[GENERAL] Serialized Access

2008-06-25 Thread Phillip Mills
I'm working on an application that uses EJB3 entities in JBoss, with Hibernate and a PostgreSQL database. One of the entity tables needs consistent, synchronized updates to rows in an environment where telling the user that their operation failed and starting over is not an option. Because it's t