Thank you all for helping. Follow-Up – using the manual SQL Query of the SQLite message table took about 15% less time to run than manually querying and resending in big chunks using the SMAT DB functions. However, it took a few hours to setup, experiment and test the SQL Query, so it was a wash.
I don’t blame the SMAT DB resend functions for failing to accommodate a large regular expression when dealing with 100M+ SMAT databases – its a lot to load into memory.
We are still fighting fires from our HIS conversion over a month ago and we have not had a chance to setup a good archive process for our SMAT files and so we have only manually archived a few of them.
I have mentioned before that we prefer to have a known window of time to search in, whether it is one day or seven days. We are much more comfortable with the SMAT DB functions now and I think we will be fine with a seven day range.
To accomplish that, I think we will use the Smat History folders – we will script a process that will cycle save once per day, populating the SmatHistory folder, and then run a SQLite database “insert from” query to copy all messages older than seven days into a backup SQLite database which is stored in another location (will not be picked up by the SMAT DB search functions). A second query will “delete behind” using the same criteria. This will keep a rolling seven day history of messages.
To access the older backups, we will have another script that can copy the backup SQLite database files into the SmatHistory folder and so then include them in our searches. I’m still not clear on the format and functionality of this script – I want to make it easy to use and easy to specify which Smat DB backups to “restore”. Every night we can purge those copies of backups. Before we implement that, we have to verify that these copies of backups can actually be searchable once created in the SmatHistory folder.
To answer the last question – yes I have gotten much better at regular expressions, and also having the AND functionality of multiple criteria is significantly better than Smat File searches – this is a wonderful, long awaited improvement and our searches and resubmissions have gotten much easier.