Answer the question
In order to leave comments, you need to log in
What is the best way to execute SQL?
There is a need to delete data from tables, create tables, the question is how best to implement this, what will be faster?
Call queries directly:
dbcur.execute = f"""DELETE FROM table_test WHERE mont = {mont}"""
dbcur.execute(f"EXECUTE DELETE_TABLE('{mont}')")
Answer the question
In order to leave comments, you need to log in
The stored procedure has an already compiled query plan (in MS SQL, Sybase this is exactly the case).
Theoretically, if the query is complex, the stored procedure will be faster by the time it takes the optimizer to build the plan.
But practically, on single queries, there will be no visible difference.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question