Efficient Conditional Selection of Data Set Rows

I have around 500,000 rows of images. The data are organised into groups. Each group is one volume.

there is a column for the group id.

However, I am finding that when I try to retrieve one volume using filter, it takes a good 5 minutes to complete.

So my requirement is that given an idx as input I should return all the images from that group. What is the most efficient way to do this?