AWS Certified Developer Associate Practice Test 2

© examsiri.com
Question : 43 of 50
 
Marks: +1, -0

A developer has pushed a Lambda function that pushes data into an RDS MySQL database with the following Python code:

def handler(event, context):
    mysql = mysqlclient.connect()
    data = event['data']
    mysql.execute(f"INSERT INTO foo (bar) VALUES (${data});")
    mysql.close()
    return

On the first execution, the Lambda functions takes 2 seconds to execute. On the second execution and all the subsequent ones, the Lambda functions take 1.9 seconds to execute.

What can be done to improve the execution time of the Lamdba function?

Go to Question: