Slow TextColumn with relationship exists

I am using the below code on my Client table:
Tables\Columns\IconColumn::make('estimates_exists')->exists('estimates')->boolean(),


This is the relationship:
public function estimates()
    {
        return $this->hasMany(Estimate::class);
    }


It could have thousands of estimates.

I simple need a boolean tick on my Table List to show if a client has an estimate against their name.

The issue is its very very slow to load the page. If I comment out this line then its fast again.

I dont suppose any knows of a better way to speed this up?
Solution
problem solved. I didnt have index's setup in the database.
Was this page helpful?