I have a query that populates table data from another table. Now it looks like this.
String query = "INSERT into TEMP_TABLE_ID (SELECT USERS_ID, rownum, US_NUMBER from USER_LOG_NUMBER where USERS_ID=(?))";
int count = db.createNativeQuery(query).setParameter(1, usersId).executeUpdate();
On 10 000 records it execute about 10 seconds. But there will be cases when there will be 10,000,000 records and I'm afraid that it will be slow. Can i do it faster?