DataTables are assets so as any other asset it is is loaded wither if you load something that reference it or manually with TSoftObjectPtr (TSoftObjectPtr | Unreal Engine Documentation), once that happens everything stays in memory until nothing is using it (not referenced anywhere anymore) then it’s unloaded.
If you circling thru large amount of data even in memory can freeze as you delaying game thread processes by doing so, so you should do that only when user don’t notice that.