It depends.
When the client process sends a request to the database, the database will continue processing that request until it has a response. If the client process dies after sending the request, the database has no way of knowing this until it is ready to send the response. At that point, it can determine that the client process has failed and abandon the request. If the performance issue that you are worried about is that it takes the database a long time to run the query in order to return the first row of the result, killing the client process will have no effect on that.
On the other hand, if the performance issue that you are worried about is that it takes a long time for the database to run the query to fetch all the rows and that it takes a long time for the client application to fetch all the data from the database, killing the client will stop the query from running. Remember that behind the scenes, the process is always
- Client sends a request
- Database begins processing the request
- Once the database has the first batch of results, it sends them to the client
- Client processes the first batch of results and requests the next batch
- Database processes the next batch of results, sends the next batch to the client
- Rinse and repeat until there are no more results to return.
If most of the time is being spent in the iterative portion rather than waiting for the database to produce the first batch of results, killing the client process will stop the database from spending more time generating more batches. Depending on the database settings (in particular, whether dead connection detection (DCD) is enabled), you may still want to kill the database session because it may sit there waiting for the client process to request the next batch of results but it won't be actively consuming resources while waiting.