I am looking for help in the best way (fast/efficient) to display a record count in a grid for each row.
Let me explain

Currently, I have a table with job information, "Jobs" and a table called "appointments" so what I am wanting to do
is have the number of upcoming appointments (even if it is zero) show per row as text on a button in a grid using the jobs table as it's main query. The button click would show the upcoming appointment information. So this is based on the >=startdate field in the appointments table.


I have tried different ways to get the record count, and display per row the number of upcoming events by creating a linked grid and updating it per row - this is way too slow but works. So what I had was a linked grid in the row that essentially showed the number of appointments and the date of those, and even though it was just that info in the linked grid - in a per row update 65-70 records runs very slow to retrieve the info in the linked grid. I then tried using row expanders but really that is about the same thing and isnt exactly what I REALLY want which is to load the grid with the jobs and in (for) each row get a record count of appointments that match the jobid and have a startdate that is >= todays date.

My next attempt is using a view
I have a view setup to retrieve only upcoming appointment called "myview" it contains the job and appointment info from curdate() forward.
I think I could get a record count from the view but again wouldn't this be slow also per row?


Maybe I need to use a UX for this with a parent-child list and use summary events? Am I asking too much from a grid?
Maybe a state variable that updates a value per row based on a sql look-up? seems like a slow method as well...
OR should I modify my sql query in teh first place to display all the jobs with appointments beyond curdate - I did try this but kept getting
Hope I provided enough info for your opinions! It makes sense in my head, lol.