On 30.08.2011 13:29, Alexander Korotkov wrote:
On Tue, Aug 30, 2011 at 1:13 PM, Heikki Linnakangas<
heikki.linnakan...@enterprisedb.com>  wrote:

So, over 50% of the CPU time is spent in choosing a block from the
temporary files. That should be pretty easy to improve..

Yes, probably we can just remove free blocks sorting.

Ok, the first results are in for that:

         testname          |   nrows   |    duration     | accesses
---------------------------+-----------+-----------------+----------
 points unordered buffered | 250000000 | 06:00:23.707579 |  4049832

From the previous test runs, the unbuffered index build took under 4 hours, so even though this is a lot better than with the sorting, it's still a loss compared to non-buffered build.

I had vmstat running during most of this index build. At a quick glance, it doesn't seem to be CPU bound anymore. I suspect the buffers in the temporary file gets very fragmented. Or, we're reading it in backwards order because the buffers work in a LIFO fashion. The system seems to be doing about 5 MB/s of I/O during the build, which sounds like a figure you'd get for more or less random I/O.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to