Re: [firebird-support] Re: Space used null values

2018-05-21 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 21-5-2018 08:09, hugo.lar...@yahoo.com [firebird-support] wrote:
> I have a followup question.
> If I have a varchar(1000) column with 1000 characters in it and then i 
> delete the value in only that column but keep the row. The row has other 
> columns with values.
> Will the space be reclaimed and overwritten?

Yes and no. Firebird is a MVCC (Multi-Version Concurrency Control) 
database, when you update a row, a new version of that row is created, 
and the old one links to the new one. Only when there are no more 
transactions interested in the old version, will it become eligible for 
garbage collection. Similarly, when you delete a row, a new version is 
inserted that is known as a deletion stub. When no transactions are 
interested in old version, both the old version and the deletion stub 
become eligible for garbage collection.

See also https://www.firebirdsql.org/en/multi-version-concurrency-control/

-- 
Mark Rotteveel


[firebird-support] Re: Space used null values

2018-05-21 Thread hugo.lar...@yahoo.com [firebird-support]
Hi,

I have a followup question.
If I have a varchar(1000) column with 1000 characters in it and then i delete 
the value in only that column but keep the row. The row has other columns with 
values. Will the space be reclaimed and overwritten? 

 BR,
Hugo



[firebird-support] Re: Space used null values

2018-02-27 Thread Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]
27.02.2018 06:42, hugo.lar...@yahoo.com [firebird-support] wrote:
> 
> Does null values take up disk space?

Yes, but much less than the declared column size.

> If I have a table with 4 VARCHAR columns and I add 4 more does the table 
> need double space even if the new columns are null?

Already existing records will not be extended at all, the occupied space 
will remain the same. New record versions may slightly increase in size, 
but not double.


Dmitry