DRAFT

Optimizing Query Performance

OdxSQL Explain Plans

  1. Perform a select
  2. issue an explain command
odxsql> select * from table1
odxsql> explain
> explain
----------------------------------- SUMMARY -----------------------------------
Select        *
  from        TABLE1
  where       MYTEXT = 'bears';

Version:      5.1 Build 1A  (Compiled May  6 2010  21:06:44)
Optimization: MDKQUAL
----------------------------------- DETAILS -----------------------------------
Qualify (TABLE1)TABLE1 where MYTEXT = 'bears' on 1 with NOAUTORESET (Cached);
Fetchkeys $ROWID 1000 at a time on 1;
 Retrieve TABLE1 using $ROWID = $ODXID;
 Return TABLE1.MYSEQ, TABLE1.MYTEXT;
-------------------------------------------------------------------------------

For more detailed information and cpu timing statistics, issue the SET EXPLAIN COUNTS setting.

odxsql>  set explain counts 

Check the warnings check the retrieve

Any time see Retrieve, Omnidex had to read the data files.

Optimization

Nested queries can many times be optimized by Omnidex automatically. Some SQL statements that look complex like nested queries can be optimized by Omnidex.

Omnidex can look inside nested queries in the WHERE clause and can re-write the SQL and optimize.

Nested Queries in the FROM clause rarely allow Omnidex to do optimization.

Try to re-work sub-queries in the FROM clause and put them in the WHERE clause.

Nested Queries

select count(*) from INDIVIDUAL

What enables navigation from child to parent is just putting prejoin on a constraint.

Typically don't have to create custom indexes for this type of prejoin index operation.

custom indexes with prejoins can have further options such as record_complex and record_specific.

 
Back to top
sql/explain/home.txt ยท Last modified: 2012/10/26 14:51 (external edit)