If you just want to use data in worksheets without re-execution,
add new data source using the extracted tde file and replace data source,
then the query will never execute, or rather the query will be gone away.
If you want to edit the query without re-execution,
as far as I know, it's impossible.
So would you try to limit the query result temporarily?
e.g. ROWNUM = 1 or LIMIT 1 or ... it depends on your database.
Your custom SQL should only be run enough to get its metadata (column names and types). This is needed when the data source is loaded and again when you save the changes. It shouldn't take very long though. I recommend you contact support and send them your logs. If you want help here, please tell us what database you are using and post your custom SQL as well (you can remove table names if you need to).