Having come in this morning, it appears to have all been done during the night: the database is gone so I have re-created it and am importing the elements I exported in step 4.
Speaking to a colleague, it seems that the timeout message is just for AF Explorer and the AF Server actually continues to perform the requested operation in the background. So if I had just waited, my initial element deletions would have been checked in eventually and AF Explorer would have stopped timing out. Is this correct? If so, are there any plans to make this more informative because at the moment the timeout message gives the impression that the requested operation has actually failed.
Or am I completely misunderstanding how these operations work?!
The timeout message that you received was likely the timeout of the communication between the AFSDK and the AFServer, which, by default, will timeout in 5 minutes. Deleting an AFDatabase, is partly synchronous but mostly asynchronous. The synchronous part, marks the AFDatabase for deletion, then returns control to the PSE. The AFServer continues to work on the AFDatabase delete, in the background. Deleting a large tree of AFElements, without intending to delete an entire AFDatabase, can be slow, and once started, can have an impact on other operations. If you plan to add a large set of AFElements and then delete them, regularly, I would consider putting then in their own AFDatabase and then just delete the entire AFDatabase. If this is a test environment, and you don't need to preserve any of the data, consider dropping the entire PIFD database.
In my development environment, I frequently delete the entire PIFD and recreate PIFD by running the SQL scripts from .BAT file or install a fresh PIFD, run a SQL BACKUP command, run tests, then run a SQL script to break all the connections and restore the "fresh" backup, via SQL script. Obviously, this purges all of your data, but it can be helpful for certain test scenarios.
Each release of AF we work to improve delete performance, but as the relationship between AFElements and other AF Objects matures, there are more things to check on deletion, such as the relationships between AFElements, the relationship between AFElements and AFNotifications, and the relationship between AFElements and AFAnalyses.
What version of AF Server are you using? What version & edition of SQL Server are you using? How much RAM is allocated to SQL Server? What is the IO capacity of the drives that PIFD is stored on?