find: Optimisation Options

1 
1 8.1.3 Optimisation Options
1 --------------------------
1 
1 The '-OLEVEL' option sets 'find''s optimisation level to LEVEL.  The
1 default optimisation level is 1.
1 
1    At certain optimisation levels, 'find' reorders tests to speed up
1 execution while preserving the overall effect; that is, predicates with
1 side effects are not reordered relative to each other.  The
1 optimisations performed at each optimisation level are as follows.
1 
1 '0'
1      Currently equivalent to optimisation level 1.
1 
1 '1'
1      This is the default optimisation level and corresponds to the
1      traditional behaviour.  Expressions are reordered so that tests
1      based only on the names of files (for example' -name' and '-regex')
1      are performed first.
1 
1 '2'
1      Any '-type' or '-xtype' tests are performed after any tests based
1      only on the names of files, but before any tests that require
1      information from the inode.  On many modern versions of Unix, file
1      types are returned by 'readdir()' and so these predicates are
1      faster to evaluate than predicates which need to stat the file
1      first.
1 
1      If you use the '-fstype FOO' predicate and specify a filsystem type
1      'FOO' which is not known (that is, present in '/etc/mtab') at the
1      time 'find' starts, that predicate is equivalent to '-false'.
1 
1 '3'
1      At this optimisation level, the full cost-based query optimiser is
1      enabled.  The order of tests is modified so that cheap (i.e., fast)
1      tests are performed first and more expensive ones are performed
1      later, if necessary.  Within each cost band, predicates are
1      evaluated earlier or later according to whether they are likely to
1      succeed or not.  For '-o', predicates which are likely to succeed
1      are evaluated earlier, and for '-a', predicates which are likely to
1      fail are evaluated earlier.
1