[JAVA-389] Make GridFS index check/ensure less costly Created: 29/Jun/11 Updated: 02/Sep/15 Resolved: 02/Sep/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | GridFS |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | gridfs | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Add a check for the index (doesn't require a server call if cached) before calling count (always requires a server call). |
| Comments |
| Comment by Ross Lawley [ 02/Sep/15 ] |
|
There is a new GridFS implementation |
| Comment by Thilo Planz [ 30/Nov/11 ] |
|
It should not be necessary to make the GridFS instance a singleton just for this. Also, not everyone may need an index on filename, right? Ideally it should be left to the user to create the indexes he wants, and not happen automatically (and least of all as part of a constructor). If that is too big a change, then there should be a new optional flag for the constructor to not have the count/index check, and if the count does need to be run (after the fix discussed here), maybe the count could be executed with a limit of 1000 so that it returns quickly even on large collections? |
| Comment by Scott Hernandez (Inactive) [ 19/Jul/11 ] |
|
yes, it will be have to checked once, but if you don't create the GridFS as a singleton then it may do needless calls. |
| Comment by Antoine Girbal [ 19/Jul/11 ] |
|
hopefully the GridFS instance is a singleton. |