Homework 3_2024 (1)
Homework 3_2024 (1)
Homework 3_2024 (1)
Points: 2
In the prior task, you saw that creating Deadlocks is rather easy. Solving them, such that all
transactions eventually commit however, creates an overhead, e.g., for restarting the
transactions. That is, the overall system performance degrades. In this task, we thus want to
better understand what is happening and optimize the infrastructures throughput.
Hints
• There is no need to optimize loading the data into the database (unless it takes to long
for your).
• Do not increase the number of tuples, if required to distribute the load.
Hints
• Do not change the order of write operations in a transaction, e.g., to provoke canonical
locking.
• Don’t be disappointed if the most relevant bottlenecks are trivial.
• If you do some pre-processing e.g., to create batches of non-conflicting transactions: Add
this time to the run time.
• I recommend that Client and Database server run on the same machine to avoid nasty
network issues.
• Just, in case you have find that there is a major issue in the infrastructure, you can change
it almost freely. The minimal requirement is that there needs to be a client connected via
JDBC/ODBC to a Postgres database. In addition, the table schema and query should remain
the same.
• We are only interested in the run time of transaction. The time loading the data is not
relevant.
FAQ
• Q: May I use some idea or code found on the internet? A: Yes, if you can explain the
idea, and respect the corresponding license agreements. Cite and mention the sources
in the talk.
• Q: May I use ChatGPT or similar AI? A: Same answer as before.
• Q: May I optimize the client code because Java does [insert your complaint here]. A:
Yes, if the requirements mentioned in tasks are fulfilled. Mention your modifications
in the talk.
• Q: May I change internals of PostgreSQL (such as locking granularity, lock escalation
strategy, etc.), or set the locks manually. A: Sure.
• Q: May I execute all the read only queries first and then serially execute all writing
tasks? Or perform some other kind of grouping? A: Yes, but the time for building the
groups needs to be included in the measurement. Additionally, the time stops after all
Blocking tasks finish successfully.