mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
backend_firefox: improve length(url) performace
The SQLite builtin function `length()` calculates the number of Unicode code points of the given argument, while `octet_length()` calculates the number of bytes. The two functions should produce the same result for a URL since it's always ASCII-only, however, with `octet_length()` the length can be directly fetched from metadata without actually reading the URL text, thereby improving performance.
This commit is contained in:
parent
0307140980
commit
348f13df02
1 changed files with 2 additions and 2 deletions
|
@ -2091,7 +2091,7 @@ bookmark_do_list (
|
|||
"WHERE `b`.`parent` = ? AND `b`.`position` >= ? ORDER BY `b`.`position`"
|
||||
#define BOOKMARK_LIST_NOJOIN_(col) BOOKMARK_LIST_(col ", `b`.`fk` ", )
|
||||
#define BOOKMARK_LIST_EX_COLS_ \
|
||||
"length(`p`.`url`), `b`.`lastModified`, `p`.`last_visit_date`"
|
||||
"octet_length(`p`.`url`), `b`.`lastModified`, `p`.`last_visit_date`"
|
||||
#define BOOKMARK_LIST_EX_(col) \
|
||||
BOOKMARK_LIST_(col ", " BOOKMARK_LIST_EX_COLS_ " ", \
|
||||
"LEFT JOIN `moz_places` `p` ON `b`.`fk` = `p`.`id` ")
|
||||
|
@ -2181,7 +2181,7 @@ bookmark_do_lookup (
|
|||
) {
|
||||
#define BOOKMARK_LOOKUP_(join, where) \
|
||||
"SELECT `b`.`id`, `b`.`lastModified`, " \
|
||||
"`p`.`last_visit_date`, length(`p`.`url`) " \
|
||||
"`p`.`last_visit_date`, octet_length(`p`.`url`) " \
|
||||
"FROM `moz_bookmarks` `b` " \
|
||||
join "JOIN `moz_places` `p` ON `b`.`fk` = `p`.`id` WHERE " where
|
||||
#define BOOKMARK_LOOKUP_ASSOC_(col) \
|
||||
|
|
Loading…
Add table
Reference in a new issue