F9:
- Executes within Toad.
- Fetches a limited number of rows (500 by default) in initial execution.
- Does not support SQL Plus Commands.
- Very little overhead as data retrieval is the only concern.
- For data formats i.e. Date & Time fields, F9 will use the format that is set via Toad’s View menu | Toad Options | Data Grids | Data.
F5:
- Executes within external DLL.
- Fetches all rows.
- Supports some SQL Plus Commands. See SQL Plus Syntax - Supported in the Toad Help file.
- Higher overhead as it is a SQL*Plus emulator and by default will write out the column header and other SQL*Plus output unless SQL*Plus commands also exist in the script to hide the output.
- By default it generates a grid with data in addition to the text output if the "Show Script Grids" option is checked in View | Options | Scripts.
- For data formats i.e. Date & Time fields, F5 is designed to mimic Oracle’s SQL*Plus output so it uses the NLS_LANG date format either on the Oracle database server or the Oracle client.
Comparing the output of "SELECT * FROM dba_tables WHERE owner = 'SYSTEM' generates ~37,000 characters of output in the grid using F9 and ~850,000 characters of output in the Script Output tab plus an additional 37,000 characters in the Script Output grid. It takes a lot of time and resources to update the GUI with that much data.
They have different retrieval methods and tuned for different functions.
F9 is best suited for executing a single statement.
F5 is best suited for running scripts (2-N statements) or for generating SQL*Plus style report output.