I have a database based app that uses foreign keys extensively and does a lot of cross table selects from views, but It has only about 15 tables. That largest 3 table have ~116,000, ~26,000 and ~10,000 records . Records are regularly added but VERY seldom deleted or modified in normal use.
To add new features, I made a bunch of changes to a lot of the DB records, added a few more tables using with foreign keys and made some changes to the Views and SQLSelects made from Xojo as well as some of the xojo code itself … I did not think any of the changes i made to the DB structure or the selects would degrade performance.
But when I tried running the app it took 11X longer to produce a key graph (felt like it took forever and was totally unacceptable)!
By profiling I saw what was taking longer was the DB.SQLSelect statement… So I assumed that something I changed in the DB structure or the SQLSelect statements was the cause… I have been banging my had against the wall for 2 days to figure out what change was causing the slowdown. I have been trying to undo the changes I made in those one by one to find the cause…
It was only AFTER I exhausted that avenue that I remembered all the changes to the records themselves!!!
I ran a Vacuum and i got all of the old performance back with the changes in place… actually it was slightly faster!
Moral of the story: Don’t forget vacuum!