diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 71516a9a5a..8823c4515c 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -1357,7 +1357,14 @@ FileInvalidate(File file)
 File
 PathNameOpenFile(const char *fileName, int fileFlags)
 {
-	return PathNameOpenFilePerm(fileName, fileFlags, PG_FILE_MODE_DEFAULT);
+	RWFWriteLifeHint hint = RWF_WRITE_LIFE_EXTREME;
+	return PathNameOpenFileHint(fileName, fileFlags, &hint);
+}
+
+File
+PathNameOpenFileHint(const char *fileName, int fileFlags, RWFWriteLifeHint *hint)
+{
+	return PathNameOpenFilePerm(fileName, fileFlags, PG_FILE_MODE_DEFAULT, hint);
 }
 
 /*
@@ -1368,11 +1375,12 @@ PathNameOpenFile(const char *fileName, int fileFlags)
  * (which should always be $PGDATA when this code is running).
  */
 File
-PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
+PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode, RWFWriteLifeHint *hint)
 {
-	char	   *fnamecopy;
-	File		file;
-	Vfd		   *vfdP;
+	char			 *fnamecopy;
+	File	   		  file;
+	Vfd		   		 *vfdP;
+	RWFWriteLifeHint defaulthint = RWF_WRITE_LIFE_EXTREME;
 
 	DO_DB(elog(LOG, "PathNameOpenFilePerm: %s %x %o",
 			   fileName, fileFlags, fileMode));
@@ -1407,6 +1415,11 @@ PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
 	DO_DB(elog(LOG, "PathNameOpenFile: success %d",
 			   vfdP->fd));
 
+	if (hint != NULL)
+		fcntl(vfdP->fd, F_SET_RW_HINT, hint);
+	else
+		fcntl(vfdP->fd, F_SET_RW_HINT, &defaulthint);
+
 	Insert(file);
 
 	vfdP->fileName = fnamecopy;
@@ -1577,9 +1590,10 @@ TempTablespacePath(char *path, Oid tablespace)
 static File
 OpenTemporaryFileInTablespace(Oid tblspcOid, bool rejectError)
 {
-	char		tempdirpath[MAXPGPATH];
-	char		tempfilepath[MAXPGPATH];
-	File		file;
+	char			 tempdirpath[MAXPGPATH];
+	char			 tempfilepath[MAXPGPATH];
+	File			 file;
+	RWFWriteLifeHint hint = RWF_WRITE_LIFE_SHORT;
 
 	TempTablespacePath(tempdirpath, tblspcOid);
 
@@ -1594,8 +1608,9 @@ OpenTemporaryFileInTablespace(Oid tblspcOid, bool rejectError)
 	 * Open the file.  Note: we don't use O_EXCL, in case there is an orphaned
 	 * temp file that can be reused.
 	 */
-	file = PathNameOpenFile(tempfilepath,
-							O_RDWR | O_CREAT | O_TRUNC | PG_BINARY);
+	file = PathNameOpenFileHint(tempfilepath,
+								O_RDWR | O_CREAT | O_TRUNC | PG_BINARY,
+								&hint);
 	if (file <= 0)
 	{
 		/*
@@ -1608,8 +1623,8 @@ OpenTemporaryFileInTablespace(Oid tblspcOid, bool rejectError)
 		 */
 		mkdir(tempdirpath, S_IRWXU);
 
-		file = PathNameOpenFile(tempfilepath,
-								O_RDWR | O_CREAT | O_TRUNC | PG_BINARY);
+		file = PathNameOpenFileHint(tempfilepath,
+									O_RDWR | O_CREAT | O_TRUNC | PG_BINARY, &hint);
 		if (file <= 0 && rejectError)
 			elog(ERROR, "could not create temporary file \"%s\": %m",
 				 tempfilepath);
@@ -1634,7 +1649,8 @@ OpenTemporaryFileInTablespace(Oid tblspcOid, bool rejectError)
 File
 PathNameCreateTemporaryFile(const char *path, bool error_on_failure)
 {
-	File		file;
+	File			 file;
+	RWFWriteLifeHint hint = RWF_WRITE_LIFE_SHORT;
 
 	ResourceOwnerEnlargeFiles(CurrentResourceOwner);
 
@@ -1642,7 +1658,7 @@ PathNameCreateTemporaryFile(const char *path, bool error_on_failure)
 	 * Open the file.  Note: we don't use O_EXCL, in case there is an orphaned
 	 * temp file that can be reused.
 	 */
-	file = PathNameOpenFile(path, O_RDWR | O_CREAT | O_TRUNC | PG_BINARY);
+	file = PathNameOpenFileHint(path, O_RDWR | O_CREAT | O_TRUNC | PG_BINARY, &hint);
 	if (file <= 0)
 	{
 		if (error_on_failure)
@@ -1672,12 +1688,13 @@ PathNameCreateTemporaryFile(const char *path, bool error_on_failure)
 File
 PathNameOpenTemporaryFile(const char *path)
 {
-	File		file;
+	File			 file;
+	RWFWriteLifeHint hint = RWF_WRITE_LIFE_SHORT;
 
 	ResourceOwnerEnlargeFiles(CurrentResourceOwner);
 
 	/* We open the file read-only. */
-	file = PathNameOpenFile(path, O_RDONLY | PG_BINARY);
+	file = PathNameOpenFileHint(path, O_RDONLY | PG_BINARY, &hint);
 
 	/* If no such file, then we don't raise an error. */
 	if (file <= 0 && errno != ENOENT)
@@ -2401,7 +2418,8 @@ OpenTransientFile(const char *fileName, int fileFlags)
 int
 OpenTransientFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
 {
-	int			fd;
+	int				 fd;
+	RWFWriteLifeHint hint = RWF_WRITE_LIFE_SHORT;
 
 	DO_DB(elog(LOG, "OpenTransientFile: Allocated %d (%s)",
 			   numAllocatedDescs, fileName));
@@ -2427,6 +2445,7 @@ OpenTransientFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
 		desc->create_subid = GetCurrentSubTransactionId();
 		numAllocatedDescs++;
 
+		fcntl(fd, F_SET_RW_HINT, &hint);
 		return fd;
 	}
 
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index db5ca16679..962d0af824 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -41,6 +41,17 @@
 
 #include <dirent.h>
 
+#define F_LINUX_SPECIFIC_BASE 1024
+#define F_SET_RW_HINT         (F_LINUX_SPECIFIC_BASE + 12)
+
+typedef enum RWFWriteLifeHint {
+	RWF_WRITE_LIFE_NOT_SET = 0, // No hint information set
+	RWF_WRITE_LIFE_NONE,        // No hints about write life time
+	RWF_WRITE_LIFE_SHORT,       // Data written has a short life time
+	RWF_WRITE_LIFE_MEDIUM,      // Data written has a medium life time
+	RWF_WRITE_LIFE_LONG,        // Data written has a long life time
+	RWF_WRITE_LIFE_EXTREME,     // Data written has an extremely long life time
+} RWFWriteLifeHint;
 
 /*
  * FileSeek uses the standard UNIX lseek(2) flags.
@@ -64,7 +75,8 @@ extern int	max_safe_fds;
 
 /* Operations on virtual Files --- equivalent to Unix kernel file ops */
 extern File PathNameOpenFile(const char *fileName, int fileFlags);
-extern File PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode);
+extern File PathNameOpenFileHint(const char *fileName, int fileFlags, RWFWriteLifeHint *hint);
+extern File PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode, RWFWriteLifeHint *hint);
 extern File OpenTemporaryFile(bool interXact);
 extern void FileClose(File file);
 extern int	FilePrefetch(File file, off_t offset, int amount, uint32 wait_event_info);
