|
Parallel scans read blocks from disk to PGA, bypassing buffer cache. That's why I want you to alter system flush buffer_cache before the speed test. If you do that, your non-parallel scan may have physical reads (actually blocks that are read physically, not number of times of physical read) of about 436000, i.e. about the same as consistent gets.
In most SQL tuning, you should use consistent gets as a metric. But if parallel scan is involved, the goal is changed to getting the query result as fast as possible. Then query elapsed time becomes more important.
The reason why your parallel scan has a little higher consistent gets than the non-parallel is probably because of the overhead of parallelism, spawning more processes, distributing and merging the intermediate data (a.k.a table queue), etc.
Whether you should use serial (non-parallel) scan and make use of the buffer cache depends on whether this query will be run many times, possibly concurrently by many sessions.
Yong Huang |
|