Interview practice question
Reading a large table over JDBC
Data Engineering · Spark · Intermediate
Your Spark job reads a 300 million row table from Postgres over JDBC and it's very slow, using a single task. How do you speed it up?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Default JDBC reads use one connection and one partition.
- Use partitionColumn, lowerBound, upperBound and numPartitions.
- Choose an evenly distributed numeric or date column.
- Increase fetchsize.
- Don't overload the source; consider incremental reads or exports.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.