Fossil SCM

A very slight query reformulation in (wiki create --technote) which speeds it up by orders of magnitude on large repos. Bug report and suggested fix in [forum:a3f7ddbe2fdb45d7|forum post 2026-10-07T13:56:00Z].

stephan 2026-10-08 08:00 UTC trunk
Commit ffc9cab3acfa3d9fffbe972966969636a834f78187c599f5136a228bebd9cd45
1 file changed +5 -5
+5 -5
--- src/wiki.c
+++ src/wiki.c
@@ -2146,21 +2146,21 @@
21462146
** At present, technote tags are prefixed with 'sym-', which shouldn't
21472147
** be the case, so we check for both with and without the prefix until
21482148
** such time as tags have the errant prefix dropped.
21492149
*/
21502150
rid = db_int(0, "SELECT e.objid"
2151
- " FROM event e, tag t, tagxref tx"
2151
+ " FROM event e"
21522152
" WHERE e.type='e'"
21532153
" AND e.tagid IS NOT NULL"
2154
- " AND e.objid IN"
2154
+ " AND (e.objid IN"
21552155
" (SELECT rid FROM tagxref"
21562156
" WHERE tagid=(SELECT tagid FROM tag"
2157
- " WHERE tagname GLOB '%q'))"
2158
- " OR e.objid IN"
2157
+ " WHERE tagname GLOB '%q')))"
2158
+ " OR (e.objid IN"
21592159
" (SELECT rid FROM tagxref"
21602160
" WHERE tagid=(SELECT tagid FROM tag"
2161
- " WHERE tagname GLOB 'sym-%q'))"
2161
+ " WHERE tagname GLOB 'sym-%q')))"
21622162
" ORDER BY e.mtime DESC LIMIT 1",
21632163
zETime, zETime);
21642164
}
21652165
return rid;
21662166
}
21672167
--- src/wiki.c
+++ src/wiki.c
@@ -2146,21 +2146,21 @@
2146 ** At present, technote tags are prefixed with 'sym-', which shouldn't
2147 ** be the case, so we check for both with and without the prefix until
2148 ** such time as tags have the errant prefix dropped.
2149 */
2150 rid = db_int(0, "SELECT e.objid"
2151 " FROM event e, tag t, tagxref tx"
2152 " WHERE e.type='e'"
2153 " AND e.tagid IS NOT NULL"
2154 " AND e.objid IN"
2155 " (SELECT rid FROM tagxref"
2156 " WHERE tagid=(SELECT tagid FROM tag"
2157 " WHERE tagname GLOB '%q'))"
2158 " OR e.objid IN"
2159 " (SELECT rid FROM tagxref"
2160 " WHERE tagid=(SELECT tagid FROM tag"
2161 " WHERE tagname GLOB 'sym-%q'))"
2162 " ORDER BY e.mtime DESC LIMIT 1",
2163 zETime, zETime);
2164 }
2165 return rid;
2166 }
2167
--- src/wiki.c
+++ src/wiki.c
@@ -2146,21 +2146,21 @@
2146 ** At present, technote tags are prefixed with 'sym-', which shouldn't
2147 ** be the case, so we check for both with and without the prefix until
2148 ** such time as tags have the errant prefix dropped.
2149 */
2150 rid = db_int(0, "SELECT e.objid"
2151 " FROM event e"
2152 " WHERE e.type='e'"
2153 " AND e.tagid IS NOT NULL"
2154 " AND (e.objid IN"
2155 " (SELECT rid FROM tagxref"
2156 " WHERE tagid=(SELECT tagid FROM tag"
2157 " WHERE tagname GLOB '%q')))"
2158 " OR (e.objid IN"
2159 " (SELECT rid FROM tagxref"
2160 " WHERE tagid=(SELECT tagid FROM tag"
2161 " WHERE tagname GLOB 'sym-%q')))"
2162 " ORDER BY e.mtime DESC LIMIT 1",
2163 zETime, zETime);
2164 }
2165 return rid;
2166 }
2167

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button