Re: [sqlite] Compacting a database

2005-02-01 Thread [EMAIL PROTECTED]
Hi !
An interesting enchantment may be (if anyone development that) an 
"VACUUM INFILE" method.
That is (when many pages are unuseable (free) in db) a "pragma signed" 
transaction.
If flag is -1, the db engine is use the last, and nearly to last pages. 
When flag is 1, the engine is use first, and nearly to first pages.
When many pages are deleted, we are use -1, and relocate datas. When it 
is finished, we are use 1, and relocate page nearly to file begin position.
If we have enough pages, the file size is not changed until this progress.
Then the empty pages are in the end of file, we can truncate that.

See that:
xxx xxx x x x xxx x |
->x |
x<- |
truncate
x|
This is like an unfragmenting method in windows file systems... :-)
But that is db engine dependent, so it is my idea now... :-)
Sorry for disturbing:
  ft
Dan Kennedy wrote:
Version 3.1 supports "pragma auto_vacuum" as an alternative.
3.1 is currently still in alpha stage though.
http://www.sqlite.org/pragma.html#modify

 




Re: [sqlite] Compacting a database

2005-02-01 Thread Dan Kennedy

Version 3.1 supports "pragma auto_vacuum" as an alternative.
3.1 is currently still in alpha stage though.

http://www.sqlite.org/pragma.html#modify




--- [EMAIL PROTECTED] wrote:

> 
> 
> 
> Thanks.
> I am not sure this is very useful, because it copies the database, which
> requires that there be enough file space for a copy.
> It would be nice if there was something that worked by truncating the file.
> 
> Clive
> 
> 
> 
> 
> 
> Dick Davies <[EMAIL PROTECTED]> on 01-02-2005 13:40:13
> 
> Please respond to Dick Davies <[EMAIL PROTECTED]>
> 
> To:   sqlite-users@sqlite.org
> cc:(bcc: clive/Emultek)
> 
> Subject:  Re: [sqlite] Compacting a database
> 
> 
> 
> * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [0212 11:12]:
> >
> >
> >
> > Is there a way to compact a database after removing data?
> 
> vacuum ?
> 
> --
> 'One cannot make an omelette without breaking eggs --
>  but it is amazing
> how many eggs one can break without making a decent omelette.'
>   -- Charles P. Issawi
> Rasputin :: Jack of All Trades - Master of Nuns
> 
> 
> 
> 
> 
> 
> 





__ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail


Re: [sqlite] Compacting a database

2005-02-01 Thread clive



Thanks.
I am not sure this is very useful, because it copies the database, which
requires that there be enough file space for a copy.
It would be nice if there was something that worked by truncating the file.

Clive





Dick Davies <[EMAIL PROTECTED]> on 01-02-2005 13:40:13

Please respond to Dick Davies <[EMAIL PROTECTED]>

To:   sqlite-users@sqlite.org
cc:(bcc: clive/Emultek)

Subject:  Re: [sqlite] Compacting a database



* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [0212 11:12]:
>
>
>
> Is there a way to compact a database after removing data?

vacuum ?

--
'One cannot make an omelette without breaking eggs --
 but it is amazing
how many eggs one can break without making a decent omelette.'
  -- Charles P. Issawi
Rasputin :: Jack of All Trades - Master of Nuns








Re: [sqlite] Compacting a database

2005-02-01 Thread Dick Davies
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [0212 11:12]:
> 
> 
> 
> Is there a way to compact a database after removing data?

vacuum ?

-- 
'One cannot make an omelette without breaking eggs --
 but it is amazing
how many eggs one can break without making a decent omelette.'
-- Charles P. Issawi
Rasputin :: Jack of All Trades - Master of Nuns


[sqlite] Compacting a database

2005-02-01 Thread clive



Is there a way to compact a database after removing data?

Clive