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].
Commit
ffc9cab3acfa3d9fffbe972966969636a834f78187c599f5136a228bebd9cd45
Parent
2d6bfabc9e6cd31…
1 file changed
+5
-5
+5
-5
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -2146,21 +2146,21 @@ | ||
| 2146 | 2146 | ** At present, technote tags are prefixed with 'sym-', which shouldn't |
| 2147 | 2147 | ** be the case, so we check for both with and without the prefix until |
| 2148 | 2148 | ** such time as tags have the errant prefix dropped. |
| 2149 | 2149 | */ |
| 2150 | 2150 | rid = db_int(0, "SELECT e.objid" |
| 2151 | - " FROM event e, tag t, tagxref tx" | |
| 2151 | + " FROM event e" | |
| 2152 | 2152 | " WHERE e.type='e'" |
| 2153 | 2153 | " AND e.tagid IS NOT NULL" |
| 2154 | - " AND e.objid IN" | |
| 2154 | + " AND (e.objid IN" | |
| 2155 | 2155 | " (SELECT rid FROM tagxref" |
| 2156 | 2156 | " 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" | |
| 2159 | 2159 | " (SELECT rid FROM tagxref" |
| 2160 | 2160 | " WHERE tagid=(SELECT tagid FROM tag" |
| 2161 | - " WHERE tagname GLOB 'sym-%q'))" | |
| 2161 | + " WHERE tagname GLOB 'sym-%q')))" | |
| 2162 | 2162 | " ORDER BY e.mtime DESC LIMIT 1", |
| 2163 | 2163 | zETime, zETime); |
| 2164 | 2164 | } |
| 2165 | 2165 | return rid; |
| 2166 | 2166 | } |
| 2167 | 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, 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 |