--- rrdtool-1.2.23/src/rrd_open.c.orig	2007-05-02 13:06:10.000000000 -0500
+++ rrdtool-1.2.23/src/rrd_open.c	2007-11-09 15:32:58.000000000 -0600
@@ -62,8 +62,10 @@
  *
  *****************************************************************************/
 
+#define _POSIX_C_SOURCE 200112L /* for posix_fadvise */
 #include "rrd_tool.h"
 #define MEMBLK 8192
+#include <fcntl.h> /* for posix_fadvise */
 
 /* open a database file, return its header and a open filehandle */
 /* positioned to the first cdp in the first rra */
@@ -87,6 +89,13 @@
 	rrd_set_error("opening '%s': %s",file_name, rrd_strerror(errno));
 	return (-1);
     }
+
+    /* on Linux 2.6.9, POSIX_FADV_RANDOM supresses read-ahead */
+    if (0 != posix_fadvise(fileno(*in_file), 0, 0, POSIX_FADV_RANDOM)) {
+       fclose(*in_file);
+       return(-1);
+    }
+    
 /*
 	if (rdwr == RRD_READWRITE)
 	{
