Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Usunięcie nadmiaru danych
intol
post 7.06.2006, 18:23:25
Post #1





Grupa: Zarejestrowani
Postów: 110
Pomógł: 1
Dołączył: 29.07.2003

Ostrzeżenie: (10%)
X----


Witam. Jak w bazie sqlLite usunąć nadmiar danych, tzn. mam bazę, z której usunąłem ileś tam rekordów, ale jej rozmiar się nie zmniejszył.... Chciałbym ją "przebudować" jakąś funkcją, ale nie wiem jakiej użyć...

--
Edytowano

Natknąłem się na coś takiego (http://bs2000.fujitsu-siemens.com/download/Goodies/SMAWPlus/SMAWPsqli/html/faq.html#q10):

Cytat
(14) I deleted a lot of data but the database file did not get any smaller. Is this a bug?

No. When you delete information from an SQLite database, the unused disk space is added to an internal "free-list" and is reused the next time you insert data. The disk space is not lost. But neither is it returned to the operating system.

If you delete a lot of data and want to shrink the database file, run the VACUUM command (version 2.8.1 and later). VACUUM will reconstruct the database from scratch. This will leave the database with an empty free-list and a file that is minimal in size. Note, however, that the VACUUM can take some time to run (around a half second per megabyte on the Linux box where SQLite is developed) and it can use up to twice as much temporary disk space as the original file while it is running.

As of SQLite version 3.1, an alternative to using the VACUUM command is auto-vacuum mode, enabled using the auto_vacuum pragma.


Ten post edytował intol 30.07.2006, 16:14:49


--------------------
Zbiór najlepszych technologicznych artykułów (programowanie, internet, linux)
Go to the top of the page
+Quote Post
klakons
post 7.09.2006, 16:48:01
Post #2





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 30.03.2002
Skąd: London

Ostrzeżenie: (0%)
-----


musisz uruchomic vacuum;
i gotowe. rozmiar pliku sie zmniejspozdrawiam,
marcin
Go to the top of the page
+Quote Post
komanch
post 14.06.2007, 14:46:08
Post #3





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 17.08.2006

Ostrzeżenie: (0%)
-----


Cytat(klakons @ 7.09.2006, 17:48:01 ) *
musisz uruchomic vacuum;
i gotowe. rozmiar pliku sie zmniejspozdrawiam,
marcin

witam serdecznie

przyznam szczerze, że jestem zielony jesli chodzi o obsługę sqlite
mam podobny problem jak kolega zakładający temat
z tym że ja nie mam pojęcia jak powinna wyglądać 'command line' czy cokolwiek innego zeby uruchomić funkcję vacuum

posiadam jedynie plik sqlite3.exe
oraz plik bazy forum PunBB który nie ma żadnego rozszerzenia typu np .db (chyba że tak ma być)
co z tym zrobić?

dziękuję
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 27.04.2024 - 08:15