djhodor
01/06/2022, 10:05 AMlet query = this.supabase.from<SupabaseMessage>('request').select('*').order('created_at', { ascending: false }).limit(limit);
Then I created index in supabase's SQL editor:
CREATE INDEX idx_request_created_at
ON request(created_at);
It works well in the SQL editor, however it looks like it doesn't work when I'm querying data via the sdk (the index is not used, it takes ages to fetch these data).chipilov
01/06/2022, 11:01 AMdjhodor
01/06/2022, 11:11 AMchipilov
01/06/2022, 11:15 AMchipilov
01/06/2022, 11:15 AMdjhodor
01/06/2022, 11:15 AMdjhodor
01/06/2022, 11:16 AMchipilov
01/06/2022, 11:39 AMgaryaustin
01/06/2022, 12:13 PMdjhodor
01/06/2022, 12:15 PMdjhodor
01/06/2022, 12:31 PMSELECT "public"."request".*FROM "public"."request" ORDER BY "public"."request"."created_at" DESC NULLS LAST LIMIT 100 OFFSET 0
this one is from sql editor:
SELECT * FROM request ORDER BY created_at DESC LIMIT 100
why the js sdk adds the NULLS LAST
? the column is not nullablechipilov
01/06/2022, 12:55 PMdjhodor
01/06/2022, 12:55 PMnullsFirst: true
to the order
methoddjhodor
01/06/2022, 12:56 PMchipilov
01/06/2022, 12:59 PMdjhodor
01/06/2022, 1:11 PMgaryaustin
01/06/2022, 1:13 PMgaryaustin
01/06/2022, 2:03 PMdjhodor
01/06/2022, 2:27 PMgaryaustin
01/06/2022, 2:40 PM