did you try using the NPE?
By using the NPE and microflow, you can easily achieve this functionality.
And if you are using NPE, you don't have to worry about objects being saved in the Database.
Just create a NPE and and an attribute( eg. count). and then create the microflow,
You can refer to the image below.
Hope it helps!
Could you elaborate on why you need to create a dropdown with 4000 records and why it's only numbers?
Also, querying 4000 numbers shouldn't be that slow, getting them all in memory however, maybe.
If it helps, you can try the Autocomplete widget from the appstore where you can enter text and execute a search microflow, returning relevant results.