You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing a challenge where I have a table with a large amount of data to process, and it doesn't fit into memory. Additionally, I need to open a transaction. However, I've noticed that I'm unable to execute another query while the cursor data is being consumed. It's becoming apparent to me that this is because I've opened the transaction and reserved an exclusive connection for it, and I can't use it while the cursor is active, as it's utilizing the connection. Is there a good way to handle this type of situation? Ideally, it wouldn't involve opening a transaction, or is there a more suitable approach that I'm unaware of? I appreciate any insights in advance.
awaitsql.begin(async(tx)=>{forawait(const[row]oftx`select * from mytemp`.cursor()){constresult=awaittx`select * from mytemp limit 1`;console.log(result);break;}});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm facing a challenge where I have a table with a large amount of data to process, and it doesn't fit into memory. Additionally, I need to open a transaction. However, I've noticed that I'm unable to execute another query while the cursor data is being consumed. It's becoming apparent to me that this is because I've opened the transaction and reserved an exclusive connection for it, and I can't use it while the cursor is active, as it's utilizing the connection. Is there a good way to handle this type of situation? Ideally, it wouldn't involve opening a transaction, or is there a more suitable approach that I'm unaware of? I appreciate any insights in advance.
Beta Was this translation helpful? Give feedback.
All reactions