mongodb/mongo-perl-driver — pull request #39 by rojasc (2012-08-20 01:10:41+00:00)
Title: Improving GridFS insert and delete speed

I noticed that for every insert and ever delete, we reinsert into system.indexes to create the two required GridFS indexes. I know have it where the indexes are created when the GridFS object is created. I also have added extra code so that if the database/collection/indexes are dropped after the GridFS object is created, it'll recreate them for the insert.

I also saw that the GridFS specification (http://www.mongodb.org/display/DOCS/GridFS+Specification) requires the files_id/n index to have the unique option. So I added that in as well.

I also removed the line in the remove() function where it created the indexes because I didn't see why it was need. I tested out deleteing from GridFS with out the indexes and It worked just fine.