IBM 000-8697 Server User Manual


 
5-22 IBM Informix OnLine Database Server Administrator’s Guide
Psort Parallel-Process Sorting Package
Psort Parallel-Process Sorting Package
Psort is a sorting package that improves performance by taking advantage of
multiprocessors to start and synchronize multiple sort processes. This
parallel-process sorting package is transparent to end users. (If you are
working on a uniprocessor machine and you set any of the parallel-sort
parameters, OnLine ignores the parameters and proceeds with nonparallel
sorting.)
Psort becomes an option for OnLine under either of three conditions:
The database server process is ordering query results. (An ORDER BY
clause appears as part of a SELECT statement.)
The database server process is eliminating duplicates. (The UNIQUE
or DISTINCT keyword appears in the SELECT statement.)
The database server process is executing a sort-merge join, a new
multitable join method that is used with the older “nested-loop” join
method.
How Psort Works
To enable Psort, set the PSORT_NPROCS environment variable, which defines
the upper limit for the number of processes used to sort a query. To disable
Psort, unset the PSORT_NPROCS environment variable. (Refer to the next
topic for guidelines for setting the value of PSORT_NPROCS.)
If Psort is enabled, OnLine performs parallel sorting only when performance
is likely to improve. OnLine does not employ parallel sorting for a small
number of input rows or if a table index supports the order requested in the
query.
If OnLine engages Psort, multiple sorted runs are made in memory, written
to disk, and then merged from disk into a single result stream. OnLine calcu-
lates the number of processes to use in the sort based on the size of the query
and the number of processors on the system. You can tune Psort by limiting
the maximum number of processes available to OnLine and by directing
OnLine to use directories on different disks for the intermediate writes.