jatpat / phpliteadmin

Automatically exported from code.google.com/p/phpliteadmin
0 stars 0 forks source link

"table_empty" action shouldn't always vacuum database #228

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a database with some big tables.

Sometimes, I create a "Test" table to test some things, but normally I don't 
fill it very much (normally, less than 10 entries).

After a test, I want to empty the table, but not drop it because I want to do 
another test, and I need same table structure.

If I use phpliteadmin's "table_empty" functionality, I must wait a lot because 
it also uses vacuum, when there's no need to do so, because the table is tiny.

Then, I propose

* Option 1

  Before emptying the table, count the number of rows.
  If the number is big, use vacuum. If not, don't use it.

* Option 2

  Never use vacuum after emptying a table.
  Instead, phpliteadmin should advise the user to use vacuum inside completion message box.

And I think "table_drop" action should do the same.

I am using
* phpLiteAdmin v1.9.4.1 
* PHP 5.4.17
* PDO
* SQLite version 3.7.7.1
* Apache 2.4.6
* Windows XP SP3

Original issue reported on code.google.com by Loiroor...@gmail.com on 30 Aug 2013 at 5:49

GoogleCodeExporter commented 9 years ago
I think the best option would this:
When you click "Empty table", you get asked if you are sure. There should be a 
checkbox that allows you to decide whether to vacuum the db or not.
Like "Rebuild database file to recover unused space (Vacuum)"

Original comment by crazy4ch...@gmail.com on 24 Dec 2013 at 1:00