LemonLDAPNG / apache-session-mongodb

Implementation of Apache::Session which uses MongoDB as backend
https://metacpan.org/pod/Apache::Session::MongoDB
Other
2 stars 2 forks source link

Use a projection to avoid fetching all fields #7

Closed maxbes closed 5 years ago

maxbes commented 5 years ago

MongoDB gives us the ability to express which fields we are interested in when running a query. Which is exactly what the @fields array is for.

This changes modifies the cursor to only select interesting fields. This gives a very nice performance boost on the perl side (3s => 1s to fetch 50k sessions in LemonLDAP's session browser), makes bandwidth to the mongo server much lower, and it also allow MongoDB to use a covered query if its indexes allow it.