Database Management Systems

by Raghu Ramakrishnan and Johannes Gehrke

[Database Management Systems (3rd Edition)] [The Minibase Distribution] [Minibase Overview] [Minibase Modules] [Minibase Terms and Agreement] [Minibase History] [Minibase Documentation]

The Minibase Front-End

The Minibase GUI front-end allows users to invoke almost all database functions, and is described below. It can be run using the command minibaseview. There is also a text-based interface to Minibase, which is useful for running the system tests. The Catalog and Query Optimizer modes provide a powerful tool for creating synthetic catalogs and visualizing the plans generated when optimizing queries using information in these catalogs.

Design and Implementation

The current version of the GUI is written using the base Tk/Tcl toolkit (by John Ousterhout, available from Sun Microsystems and UC-Berkeley) and extensions to it (various authors). The GUI runs as a separate process, invokes the Minibase backend (which forms the core database engine), and communicates with the backend through Unix pipes.

The proper versions of the Tk/Tcl toolkit and extensions are necessary to run the GUI---these toolkits are part of the Minibase distribution and need to be installed as appropriate.

Operating Modes

The GUI operates in three different modes:
  • The Catalog Editor mode.
  • The Query Optimizer mode.
  • The Database mode.
Some of the functionality of the GUI is common to all modes while some commands are available only in certain modes. The transition from one mode to the other in the GUI is generally transparent to the user---they are mentioned here only to simply the description of the front-end.

Global and context-sensitive help is available for most parts of the GUI; it is also simple and easy enough to use that the user can figure out most of the functionality by experimenting with the tool.

The Catalog Editor Mode

On invocation, the GUI starts out in the Catalog Editor mode. Although, the GUI process spawns and connects (via Unix pipes) to the Minibase backend, it does not yet allow the user to invoke any database related functions.

The only functional part of the GUI is the Catalog Editor. The Catalog Editor provides a syntax directed, forms-based interface to creating and editing Minibase catalogs (without the user having to understand the underlying catalog format).

Minibase catalogs created and edited via the Catalog Editor are stored as files i.e. they are not automatically associated with the Minibase backend or with any databases.

The Query Optimizer Mode

When a Minibase catalog is "opened" (rather than "created" or "edited"), the GUI switches to the Query Optimizer mode. In this mode, all of the Catalog Editor functions are still available. From this point on, the GUI switches back and forth between the Query Optimizer and Database modes only---it does not revert to the Catalog Editor mode (however, all Catalog Editing functions remain accessible to the user).

In the Query Optimizer mode, the user can type SQL queries against the "opened" catalog (henceforth, "current catalog"), have the query optimized (i.e. have various query plans generated by the Minibase backend and the best plans selected). The selected query plans are then displayed in the main window of the GUI. These plans can then be examined in detail. The user can also make various refinements to the plans via "toggles" available in the GUI menus and observe the effects of changes in query optimization strategy on the selection of different plans by the optimizer.

Examples exercises and catalogs are included in the directory programs/opttool/catalogs. The catalogs and exercises test various parts of the optimizer and demonstrate the effects of indexes, availability of access methods, query selectivity, joins, sorting, data clustering, and so on.

In the Query Optimization mode, no query plan is actually evaluated against any data since the current catalog is not associated with any actual database.

The Database Mode

When the user "opens" a database, the GUI switches from its previous mode (Catalog Editor or Query Optimizer) to the Database mode. As mentioned before, all Catalog Editor functions are still available. The Minibase backend loads the "opened" database (henceforth "current database") and performs any necessary initializations. At this point, a number of additional functions are available to the user.

Every valid Minibase database has an internal catalog---when users create new databases, they need to associate a catalog with each database. Existing catalogs may also be modified (however, the GUI cannot be used for modifying catalogs bound to databases---the Minibase C++ interface should be used for making changes to the bound catalogs).

Users can invoke database operations: inserting and deleting tuples into relations, and updating them. Data can also be read in from, and printed out to files/printers. In addition to these database functions, users can also perform all the functions available in the Query Optimization mode and execute query plans against the relations/tuples in the database.

The Database mode remains active until the user "opens" a catalog---when the GUI switches to the Query Optimizer mode.

Termination and Cleanup

The GUI can be terminated in one of two ways. Menu buttons provide for a graceful exit, in which case the Minibase backend is properly shutdown and the GUI terminates; and an abort function, in which case the Minibase backend and GUI are terminated. The "abort" may be required if the Minibase backend is unable to recover from an error (in previous versions of Minibase, some syntax errors in user commands occasionally caused a loss of synchronization between the GUI and the backend).


Back to the List of Components
Back to the Minibase Home Page