list of chapters    previous chapter   next chapter

Ch 13 - Subset databases


Ch 13 - Subset databases

Subset databases are fully-working Powerbase databases with exactly the same structure as the main database but containing only a selection of its records.

13.1 Creating a subset

Creating a subset is extremely simple. Choose Export subset from the main menu and you will see a window strongly resembling the one used to export CSV files. It features our old friend the Query panel into which you type a search formula which determines the records to be exported as a subset.

It is then only necessary to enter a suitable filename and drag the database icon to a filer window. The default pathname creates the new database as !Subset in the same directory as the parent database. You can accept this default by just clicking on Export or typing Return. Records are exported from the currently-selected subfile and will be placed in the corresponding subfile of the subset database.

You can export records from several subfiles, not just the current subfile, and they will be in the same subfiles in the subset database.

On opening the new database you will find that it functions exactly like the original but contains only the selected records. It is made just large enough to contain the selected records so you will need to increase its length (see 10.5 ) if you intend to add any further records.

13.2 Using a subset to shorten a database

A database which has undergone a lot of deletions might have blank records scattered at random throughout its Database file and unused keys scattered at random throughout its indexes. If a database has 100 available records of which only 50 are in use you might want to get rid of the surplus records but aren't able to do so by the simple shortening procedure described in Ch 10.5 because that only allows you to lop off the end of the database. The amount by which the database can be shortened is often much less than the number of in-use records would suggest: in extreme cases you might not be able to shorten it at all by this method. (Don't be afraid to try, however. Powerbase won't let you butcher your database; it just tells you you can't do it.)

The solution to the problem is to export all the records as a subset. Simply follow the instructions in 13.1 , with all occupied subfiles selected in the Query panel, but don't type anything into the query panel. The resulting subset will contain the 50 in-use records and no extras at all.



top of page   list of chapters    previous chapter   next chapter