Prisma 1 Forum

Excessive SQL Database Row Count Heroku Costing More Money

I imagine it is probably too late to change the way the sql databases are constructed with relationships and the tables it creates. However, the problem I’m having is that before when I had relationships just in a column on a table. i.e user would have a column with a foreign key column of house_id. Now Prisma creates a new table and a new row, therefore there are 2 rows for every relationship. This becomes a cost problem with services like AWS or Heroku databases where they charge per row.

This is more a concern with the general product itself and is a bit concerning tbh. Has there been any discussion around this?

1 Like

Hi @seawatts

Have you checked out datamodel 1.1(it is currently in beta under a prototype flag). It support inline linked relations that might solve this issue.


it allows you to do something like this:

type Blog {
  id: ID! @id
  posts: [Post] @relation(link: INLINE)

type Post {
  id: ID! @id
  title: String!
  blog: Blog

this will join them inline.

Also see, if you want to check the beta out

Wow this is exactly what I was hoping for! Thanks @pantharshit00 I’ll check it out.

That worked great! Thanks again @pantharshit00

1 Like