How do I quickly search for data stored in an XML file within a large number of directories?
A project I have been working on for the past year writes out log files to a network drive every time a task is performed. We currently have about 1300 folders each with a number of files and folders. The important part here is that we have about 3-4 XML files on average within each folder that contain serial numbers and other identifying data for our products. Early on it was easy to just use Windows file search, but now it can take over 10 minutes to search that way. The need for a log viewer/searcher has arose and I need to figure out how to make it fast. We are considering a number of ideas. One being a locally stored XML index file, but I think that will eventually get too big to be fast. Second was to create a folder watching service that will write index information to an SQL database and link to files. Third idea was to have the program writing the log files also write index information to the database. The second database option is sounding like the best option right now since we already have a bunch of history that will need to be indexed, but to me it sounds a little convoluted. So 开发者_JS百科my question in short is: How can I quickly search for information contained in XML files in a large and constantly growing number of directories?
We ended up using an SQL database to do this, for many reasons:
- It maintained much faster query times in a simulated 10-year data growth (1.5 mil - 2 mil entries still had under 2 seconds) than XML (about 20-30 seconds).
- We can have the application directly publish data to the database, this removes the need for a crawler (other than for initial legacy data).
- There could have been potential issues with file locking if we decided to host the file on the network somewhere.
精彩评论