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
It would be nice to have something like postgres for the index creation also Like
CREATE INDEX test2_info_nulls_low ON test2 (info NULLS FIRST);
CREATE INDEX test3_desc_index ON test3 (id DESC NULLS LAST);
Describe the solution
.
Alternative methods
Currently the only way I can find to order by index is do a query with a WHERE instruction that I know that will match everything
For example I have a table with a indexed field to order if I want to use it for sorting will only work fast for ASC
sortingField = [1, 2, 3, 4 .... etc ]
SELECT * FROM Table WHERE sortingField > 0 limit 10; Return 10 records in ascending order from sortingField very fast
if I use ORDER BY sortingField DESC is very slow
Only way I found to do a Desc Search is to copy the sortingField and negate it (negate_sortingField = [-1, -2, -3, -4 .... etc ]
SELECT * FROM Table WHERE negate_sortingField < 0 limit 10; Return 10 records in descending order from negate_sortingField very fast
SurrealDB version
1.0.0+20230913.54aedcd for linux on x86_64
Contact Details
No response
Is there an existing issue for this?
I have searched the existing issues
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
It would be nice to have something like postgres for the index creation also Like
CREATE INDEX test2_info_nulls_low ON test2 (info NULLS FIRST);
CREATE INDEX test3_desc_index ON test3 (id DESC NULLS LAST);
Describe the solution
.
Alternative methods
Currently the only way I can find to order by index is do a query with a WHERE instruction that I know that will match everything
For example I have a table with a indexed field to order if I want to use it for sorting will only work fast for ASC
sortingField = [1, 2, 3, 4 .... etc ]
SELECT * FROM Table WHERE sortingField > 0 limit 10; Return 10 records in ascending order from sortingField very fast
if I use ORDER BY sortingField DESC is very slow
Only way I found to do a Desc Search is to copy the sortingField and negate it (negate_sortingField = [-1, -2, -3, -4 .... etc ]
SELECT * FROM Table WHERE negate_sortingField < 0 limit 10; Return 10 records in descending order from negate_sortingField very fast
SurrealDB version
1.0.0+20230913.54aedcd for linux on x86_64
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: