0

I have a foreign table defined with file_fdw, which reads the data from a CSV file. Postgresql parses the CSV file and converts the date for example from YYYYMMDD to YYYY-MM-DD. This works fine.

My question is how often gets the CSV file parsed? Does it get parsed on every select? Or does it get cached? And if so how long does it get cached?

1
  • 1
    There is no caching for this, they get parsed every time, this is one of the reason why FDW can be a bottle neck for performance as the server has no means to track what is happening externally so it must re-query the remote data Commented Jan 22, 2020 at 17:08

1 Answer 1

2

The file is read whenever the foreign table is scanned, which can happen several times during processing of a query.

There is no caching except the file system cache of the operating system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.