Board index » delphi » Deleting records from Paradox table.

Deleting records from Paradox table.

Does anybody know what is happening when we delete records from a Paradox
table. For foxprox and DBF tables I know that the records do not delete
physicaly and they should be removed by packing the file.

Thanx
Amer

 

Re:Deleting records from Paradox table.


Hi,

The same thing happens with Paradox. To reclaim the space used by the deleted
record(s) you must pack the table.

cheers,
Phillip Flores
PCF Consulting

Quote
Amer Amiri wrote:
> Does anybody know what is happening when we delete records from a Paradox
> table. For foxprox and DBF tables I know that the records do not delete
> physicaly and they should be removed by packing the file.

> Thanx
> Amer

Re:Deleting records from Paradox table.


How to pack a table?

Quote
Phillip Flores wrote in message <3722AFBC.BAC81...@wr.com.au>...
>Hi,

>The same thing happens with Paradox. To reclaim the space used by the
deleted
>record(s) you must pack the table.

>cheers,
>Phillip Flores
>PCF Consulting

>Amer Amiri wrote:

>> Does anybody know what is happening when we delete records from a Paradox
>> table. For foxprox and DBF tables I know that the records do not delete
>> physicaly and they should be removed by packing the file.

>> Thanx
>> Amer

Re:Deleting records from Paradox table.


Not so, I think. From what I know, Paradox tables reclaim the space of
deleted records when new records are added. However, it may still be wise to
do a table pack if one has deleted a substantial number or records.

-Jeff H
Qtools Software
http://www.qtools.com

Quote
> The same thing happens with Paradox. To reclaim the space used by the
deleted
> record(s) you must pack the table.

> cheers,
> Phillip Flores
> PCF Consulting

> Amer Amiri wrote:

> > Does anybody know what is happening when we delete records from a
Paradox
> > table. For foxprox and DBF tables I know that the records do not delete
> > physicaly and they should be removed by packing the file.

> > Thanx
> > Amer

Re:Deleting records from Paradox table.


Unlike dBase tables, Paradox tables will reuse the space vacated by deleted
records so you do not have to pack them.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
 for any other reason remove nospam from my address.)

Re:Deleting records from Paradox table.


Paradox doesn't allow for deleted records recovery, else it works a bit as
dBase.
Deleted records are chained so when you create a new record, the BDE tries
first to reuse a deleted room.
So, in a "normal" situation (where deletion are few or equivalent compared
to addition) you have not to pack the table.
The only situation where a pack is needed is when a lot of records are
deleted from a table that will not use all this place in a near future.
Else, no need to pack.

--
Olivier Dahan
oda...@{*word*104}cable.fr
Delphi 32b C/S certified engineer
Amer Amiri <a_am...@hotmail.com> a crit dans le message :
7fu6s0$d...@forums.borland.com...

Quote
> Does anybody know what is happening when we delete records from a Paradox
> table. For foxprox and DBF tables I know that the records do not delete
> physicaly and they should be removed by packing the file.

> Thanx
> Amer

Re:Deleting records from Paradox table.


Quote
>Does anybody know what is happening when we delete records from a Paradox
>table. For foxprox and DBF tables I know that the records do not delete
>physicaly and they should be removed by packing the file.

Paradox records are stored in Blocks with each block having at least 3 records
in it.  When you delete a record it is removed from the block.  There then will
be an empty space in that block.  Paradox will reuse the space in the block when
a record is inserted that would by primary key order go it that block.
for a actively edited table you usually end up with about 40% vacant space in
blocks as the equilibrium point.
You can pack a paradox table to remove all empty space by restructuring it.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Deleting records from Paradox table.


Quote
>Paradox records are stored in Blocks with each block having at least 3
records
>in it.  When you delete a record it is removed from the block.  There then
will
>be an empty space in that block.  Paradox will reuse the space in the block
when
>a record is inserted that would by primary key order go it that block.
>for a actively edited table you usually end up with about 40% vacant space
in
>blocks as the equilibrium point.

Does it mean that at some moment Paradox table will become 'very
fragmented'?
I.e. my first record will be in the middle of the table, my second record in
the begining,
my third - in the end of the table.
If this table is, say, 80MB it will cause slow search or data read from the
table even if
it is indexed. Am I right?

Saulius.

Re:Deleting records from Paradox table.


For dBase tables, the deleted records remain in the file and
the space is not reused so you ought to Pack the table. For
Paradox tables, the records are deleted but the blank deleted
record remains available and is written to as you append to
the table later. You can pack Paradox tables if you want to
using the dbiDoRestructure BDE function.

Nick Spurrier (MoDESoft, UK)

Re:Deleting records from Paradox table.


Quote

>Does it mean that at some moment Paradox table will become 'very
>fragmented'?
>I.e. my first record will be in the middle of the table, my second record in
>the begining,
>my third - in the end of the table.
>If this table is, say, 80MB it will cause slow search or data read from the
>table even if
>it is indexed.
> Am I right?

No

A table is a linked list of blocks.  A Primary index is a pointer to the block
where the record  is stored.  A block does not fragment.  

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Deleting records from Paradox table.


Quote
>A table is a linked list of blocks.  A Primary index is a pointer to the
block
>where the record  is stored.  A block does not fragment.

Does A Primary index point position of the beginning of the block in the
file?
Is it something like FilePos()?

If I have, say, table of 80MB with record size of 1Kb. Then I randomly
delete 10000 records.
Later I Append 10000 records to the table (1..10000).
Where they will reside physically in the disk? If the Paradox tries to fill
empty gaps in the table,
then is it possible that 1..10 records reside in the first block, 11..90 in
the last, 9001..9011 in
the middle of table and so on.
Later, if I want to read these records from 1 to 10000, program will heavily
exploit my hard disk?

Saulius.

Re:Deleting records from Paradox table.


Quote
>Does A Primary index point position of the beginning of the block in the
>file?

Probably but I haven't gotten in to that level of detail

Quote
>If I have, say, table of 80MB with record size of 1Kb. Then I randomly
>delete 10000 records.
>Later I Append 10000 records to the table (1..10000).
>Where they will reside physically in the disk? If the Paradox tries to fill
>empty gaps in the table,

Records are placed in blocks according the their primary index order.

When a new record is inserted BDE will find the block where it belongs.  If the
block full the block will be split into two blocks.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads