Looking at libermetadb I see the following is used (when sorting on filename):
(CASE WHEN filename IS NOT NULL THEN 0 ELSE 1 END),
filename COLLATE IREX_CASE_INSENSITIVE,
directory_path COLLATE IREX_CASE_INSENSITIVE
(sort_priority is used to get folder in front of files.) I am no database expert, so its just for information.