I have an RDS instance: db.t2.xlarge (4 vCPU, 16 GiB memory) (max_parallel_workers_per_gather=2)
And another Redshift instance: dc2.large (2 vCPU, 15 GiB memory) (2 nodes)
I have loaded both with same data. I have tried different types of queries, but my RDS always runs queries in shorter time.
Example:
- I have a table called 'az_product_questions'
- It has two columns
product_id
(int) andquestion_id
(int) - I inserted it with 1,258,559 rows.
The query I am trying is as follows:
SELECT
product_id,
COUNT(*)
FROM az_product_questions
GROUP BY product_id
ORDER BY product_id ASC;
- In RDS: I didn't add any indexes.
- In Redshift: product_id is
distkey
andsortkey
Coming to performance:
- On RDS: Avg. 5 seconds
- On Redshift: Avg. 6.5 seconds
Am I trying to use Redshift for smaller database, in a wrong use-case, or in a wrong way? Or It's normal?