Re: [google-appengine] most efficient bulk delete code?

2011-08-02 Thread Robert Kluin
Just a note, I've heard the built in datastore admin delete code is running much faster recently. You might give it a shot. I have not tried it myself to verify it is running better though (previously it was quite poor). Robert On Tue, Aug 2, 2011 at 14:54, Stephen Johnson wrote: > I use

Re: [google-appengine] most efficient bulk delete code?

2011-08-02 Thread Stephen Johnson
I use the low-level datastore to do the delete by keys. On Tue, Aug 2, 2011 at 10:52 AM, Carter Maslan wrote: > thanks; what delete do you use? > It looked like deletePersistentAll() accepted only entities (rather than > key values) > > > On Tue, Aug 2, 2011 at 9:46 AM, Stephen Johnson wrote: >

Re: [google-appengine] most efficient bulk delete code?

2011-08-02 Thread Carter Maslan
thanks; what delete do you use? It looked like deletePersistentAll() accepted only entities (rather than key values) On Tue, Aug 2, 2011 at 9:46 AM, Stephen Johnson wrote: > Change your query to something like this: > > Query query = pm.newQuery("select ek from " + UploadedContent.class > .getNa

Re: [google-appengine] most efficient bulk delete code?

2011-08-02 Thread Stephen Johnson
Change your query to something like this: Query query = pm.newQuery("select ek from " + UploadedContent.class .getName()); Where "ek" is the entity key name you use in you JDO class. For example, mine is defined like the following: @PrimaryKey @Persistent(valueStrategy = IdGeneratorStra

[google-appengine] most efficient bulk delete code?

2011-08-02 Thread Carter
Is this the most efficient code for bulk delete? Is there a "SELECT __key__" technique that's faster? This currently deletes 100 at a time, but it's slow. public long deleteBefore(Date d, long maxRecords) throws DaoException { PersistenceManager