Everything that QM shows you will affect the TTFB unless you’ve specifically implemented implicit flushing in PHP. This is because PHP waits for the whole of the page to be generated before sending it to the browser.
Your TTFB will be at least the time shown under “Page generation time” in the overview at the top of QM, plus the DNS lookup time, plus the time taken for the request and response to pass over the network, etc.
As a rule of thumb, any individual database query over 0.05 seconds is very slow (and QM will highlight it as such), and on a modern server you shouldn’t expect to see queries taking longer than 0.01 seconds.
You’ll usually find that the query time isn’t a big factor in the time your page takes to generate. Unfortunately QM isn’t very good at exposing other points on the page where slowdown occurs (it’s in the works), but server side HTTP API requests can be a factor, so keep an eye out for those.