XSQL is a simple command-line driven interactive SQL utility you can use to test SQL
statements without having to write an eXtremeSQL program first, and to experiment with
different ways of expressing the query to influence the rule-based optimizer and then view the
effect on the chosen execution plan and repeat as necessary until the desired execution plan is
generated.
The format of the XSQL command line is:
XSQL DATABASE_NAME {SQL_FILE}
The database must already exist in shared memory in which case XSQL can open and connect to
it. So, one way of using XSQL is to write a program to populate a database, and then cause the
program to wait on keyboard input. Meanwhile, invoke XSQL and experiment with different
query formulations.
Alternatively, you can use XSQL to populate the database by creating a SQL_FILE, a text file
containing SQL statements, and include as many SQL INSERT statements as are needed. Note
that you can use XSQL to save a database that can be loaded in a later session, which may be
faster than re-executing many SQL statements to create an initial state for testing.
COMMAND DESCRIPTION
help Displays this list of commands
exit Ends the XSQL session
trace <on|off> Causes XSQL to display the query execution plan
format <HTML|XML|TEXT> Select the query output format of XSQL
Report Generates a report of database statistics (see example
below)
save <file> Equivalent to the mc_db_save() function, it save a
copy of the in-memory database to the specified file.
<statement> Any valid eXtremeSQL statement (i.e., SELECT,
UPDATE, INSERT, DELETE)
Example of Report Output
Database size 15976Kb
Hash Index (Album.by_seq): 300 objects, 6Kb
Tree Index (Album.by_name): 300 objects, 6Kb, height=3
Tree Index (Album.by_artist): 300 objects, 6Kb, height=3
Hash Index (Artist.by_seq): 100 objects, 2Kb
Tree Index (Artist.by_name): 100 objects, 2Kb, height=2
Hash Index (Genre.by_seq): 0 objects, 0Kb
Tree Index (Genre.by_name): 0 objects, 0Kb
Tree Index (Playlist.by_name): 0 objects, 0Kb
Hash Index (Playlist.by_nbr): 0 objects, 0Kb
eXtremeSQL User Guide version 4.5 page 75
Hash Index (Track.by_seq): 3000 objects, 69Kb
Tree Index (Track.by_name): 3000 objects, 62Kb, height=4
Tree Index (Track.by_album): 3000 objects, 62Kb, height=4
List (counter.list_index_): 1 objects, 0Kb
Tree Index (track_playlist.by_track): 0 objects, 0Kb
Tree Index (track_playlist.by_playlist): 0 objects, 0Kb
Database Instance (): 0 objects, 1020Kb
The subdirectory “xsql/scripts” provides a group of script files (with extension “.sql”) that
demonstrate various SQL statements.
download packege from http://www.mcobject.com/software_eval