Table Data Export after Filter

I see how to create an action button inside the table to extract data, there is an option to load data from a source such as a database and another option to specify data such as with checkboxes, but from both options I don’t see how to chose items currently queried in the table and after those items are filtered, how do I do this? Also, the database query brings back data to the page table very fast (seconds), but when I setup an action button to extract data from the same query it’s a very slow download time (many minutes), is there a possible way to speed up the data extract action?