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
INSERT INTO highest_voted_view (id, view) VALUES (0, $1)
ON CONFLICT (id) DO UPDATE SET view = GREATEST(highest_voted_view.view, excluded.view)";
seems unnecessary.
From the logic itself, it looks like it will try to insert a record for id0, and on conflict it changes it to an update itself.
This implies that the first time this is run, a single row will be inserted, and for ALL other invocations will result in an update instead. So it seems like we could instead just change this to an update, and populate an initial record in a migration script itself.
It's unclear how much of an impact this might have, if any, but it could still be simplified none-the-less.
The text was updated successfully, but these errors were encountered:
The Upsert provided by this statement:
espresso-sequencer/sequencer/src/persistence/sql.rs
Lines 604 to 605 in 886bb77
From the logic itself, it looks like it will try to insert a record for
id
0
, and on conflict it changes it to an update itself.This implies that the first time this is run, a single row will be inserted, and for ALL other invocations will result in an update instead. So it seems like we could instead just change this to an update, and populate an initial record in a migration script itself.
It's unclear how much of an impact this might have, if any, but it could still be simplified none-the-less.
The text was updated successfully, but these errors were encountered: