You should definitely try to do as much preprocessing in the database as possible. You can either accomplish that by performing the selection and filtering directly in your SQL statement or by using a combination of "Database Connector", "Database Column Filter", and "Database Row Filter". They all operate directly on the database. The "Database Connection Reader" then pulls the preprocessed data into KNIME.
The "Cache" node only caches all input data onto disk which might speed up iterating over data transformed in KNIME. You can find details and an example in the node description:
"Caches all input data (rows) onto disk. This is particularly useful when connected to a preceding node, which performs a column transformation. For example, a filter column node, which "hides" most of the columns to the output. This node only caches the data that is actually contained in the input table. Iterating on it may be considerably faster than accessing the table of a wrapper node."