'Will upgrading the class of the DB instance speed up my lambda application

I have a Django application that is connected to a PostgreSQL database located on AWS RDS.

Right now, because it's still in development we use a small tier (db.t3.small) which has 2vCPUs, 2GiB RAM and 2.085 Mbps.

My application is running smooth and fast, except for one model because it has over 6 million rows. It takes about 25 seconds to load even when working on localhost.
When I then switch to a local postgreSQL database on my computer with the same data it takes around 3s to load

So I'm wondering, if I upgrade to db.t3.medium or even db.t3.large that both double in RAM size from his previous tier. will this make any diffrence in speed for my application



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source