I know COPY is the best utility to export the data from a table or a query to output files. But if we are doing an export like
\COPY (select * from table) to '/tmp/file.csv' WITH CSV;
How its different from running the select query and save the results later(like in a GUI tool) or psql -c'select * from table'> output.csv
Any advantage of using COPY in terms of performance and caching?
The overall idea is, I'm trying to understand the performance benefits of exporting the data via read from select vs COPY from python psycopg