In a particular project I am required to retrieve corresponding attachments to a request submitted by a user. On one page the live requests are displayed with links to the attachments.
The project set up retrieved all the attachments name and id from the document library and queried against this using LINQ.
I have been asked to optimise the solution and identified this as possible bottleneck. My rewrite now queries this document library for each live request, only retrieving the items that correspond.
My question is, is this more efficient to open the web and query the document library when required, or to retrieve every existing attachments details and filter this using LINQ.
The list will, in time, be holding 1000's of attachments.