diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-05 10:46:14 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-05 10:46:14 -0500 |
commit | 59464bd6f928ad0da30502cbe9b54baec9ca2c69 (patch) | |
tree | e548b87c7ac2beaf08d90ecf2ef9b89f3c0f8ea2 /src/backend/access/transam/parallel.c | |
parent | 7bd099d511d66b55fedced9920357cc5c36811c7 (diff) | |
download | postgresql-59464bd6f928ad0da30502cbe9b54baec9ca2c69.tar.gz postgresql-59464bd6f928ad0da30502cbe9b54baec9ca2c69.zip |
Improve implementation of GEQO's init_tour() function.
Rather than filling a temporary array and then copying values to the
output array, we can generate the required random permutation in-place
using the Fisher-Yates shuffle algorithm. This is shorter as well as
more efficient than before. It's pretty unlikely that anyone would
notice a speed improvement, but shorter code is better.
Nathan Wagner, edited a bit by me
Diffstat (limited to 'src/backend/access/transam/parallel.c')
0 files changed, 0 insertions, 0 deletions