The request is never launched "from disk" or "from cache". The request itself is always in memory.
But if you want to find out if the data was received from shared buffers or directly from the file system, you can use
explain (analyze on, buffers on, verbose on) select ....
the execution plan will then show you how many blocks are selected from the shared buffers and how many from the file system. Note that βreadingβ from the file system can actually be returned from the cache, and the file system also controls its own cache (something uses Postgres).
source share