Not load Relation of Relations

I’m realising that I’m starting to run into memory issues.

I have three tables, and their relations are as follows:

Subscription ->1:1-> Topic ->1:n-> Stories

Are there a way when I retrieve a subscription, it will only return the Topic, but not the Stories?

Or are there a way to completely destroy it after it’s used? It seems like there are residue memory usage even after I set subscription variable to null.

By default, related objects will not be fetched. Only if you add a with() to the method chain. So check your code and remove the with() call if you don’t want that.

Thanks Mike, you’re right it doesn’t load the related objects without the with() call.