Supabase inserts are too slow in prod
I am using sveltekit and supabase. My requirements are like this 1) User can go to a page, 2) user can create a note and 3) User can see the note on the page at the right position. To achieve this positioning thing, I have a trigger function which runs after every insert. It checks the position of the note, and if require, update the position of other notes on the position. Normally a page has 5-10 notes.
I am not sure if this trigger function causing the delay, but when I connect to prod database, the response is super slow. Everything works fine in local env. I can post the note and can see right away page getting updated in less than a second. However, on production, it takes so much time and that I dont even get a response. I have to reload the page to view the new note.
Is there a better way? What am I doing wrong?
I am not sure if this trigger function causing the delay, but when I connect to prod database, the response is super slow. Everything works fine in local env. I can post the note and can see right away page getting updated in less than a second. However, on production, it takes so much time and that I dont even get a response. I have to reload the page to view the new note.
Is there a better way? What am I doing wrong?