v Where it snags
There are three places where the mechanism does something a person typing would not expect, and all three fall straight out of the leaf rule and the guard rather than out of anything going wrong, so they are behaviour rather than bugs, which is not the same as saying they are fine.
1 Β· four keystrokes that fetch nothing
digit is not a key in the index. Only two keys start with it, digital[677728:678028] and digitaria [678028:690269], so the client falls to its second branch and aggregates: lowest start, highest end, one span covering both. That span is over the guard, so nothing is requested at all.
- digaggregate677526β69026912,743 Bover 10,240, no request sent
- digiaggregate677728β69026912,541 Bover 10,240, no request sent
- digitaggregate677728β69026912,541 Bover 10,240, no request sent
- digitaaggregate677728β69026912,541 Bover 10,240, no request sent
- digitalexact677728β678028300 B7 names back for 850 bytes of CSV
- digitaliexact677728β678028300 B7 names back for 850 bytes of CSV
- digitalisexact677728β678028300 B7 names back for 850 bytes of CSV
The seventh character turns it into an exact hit and the cost collapses from the 12,541 bytes the sixth would have needed to 300 bytes actually fetched, which brings back all 7 foxgloves at once. The 4 queries before it show the visitor nothing at all, so press walk digitalis in the box above and watch it happen.
2 Β· a two-letter plant name that swallows a query
The greedy walk keeps the longest index key that is a prefix of the query, and it only aggregates when it has found none at all. In the vernacular-name index am is a real key, because four records are literally named am, so its block is four lines long and holds nothing else:
am[1038847:1039026]
am[1039026:1039183]
am[1039183:1039340]
am[1039340:1039497]
The first of the four rows those lines point at reads:
urn:lsid:ipni.org:names:69913-1,am,en,,"SEPASAL database. (RBG Kew, 1999)",http://creativecommons.org/licenses/by-nc-sa/3.0,,urn:lsid:plantsforhealth.kew.org:vernacularName:3349
Neither ame nor amer nor any prefix up to american is a key, so every query from three characters to nine resolves back to am's 80-byte block, reads its four lines, matches none of them and returns nothing. Typing american ginseng stays empty for seven keystrokes and opens on the tenth character, where american g is a key and 15 terms come back.
3 Β· the same name twice, and the rows nothing points at
The SSTable holds 44,333 entries for 44,331 distinct names, so a key can repeat. It happens exactly twice in this dataset, and both times it is one name arriving from two sources with two different rows:
aristolochia fangchi y.c.wu ex l.d.chow & s.m.hwang[1386415:1386529]urn:lsid:ipni.org:names:77221314-1,Aristolochia fangchi Y.C.Wu ex L.D.Chow & S.M.Hwang,USDA,GRIN (USDA),Accepted
[1386529:1386911]urn:lsid:ipni.org:names:92924-1,Aristolochia fangchi Y.C.Wu ex L.D.Chow & S.M.Hwang,"Diazgranados, M., Allkin, B., Black, N., CΓ‘mara-Leret, R., Canteiro, C., Carretero, J., Eastwood, R., Hargreaves, S., Hudson, A., Milliken, W., Nesbitt, M., Ondo, I., Patmore, K., Pironon, S., Turner, R. & Ulian, T.","World Checklist of Useful Pl. Spp. (Diazgranados et al., 2020)",Illegitimate
cissus rotundifolia lam.[2702557:2702692]urn:lsid:ipni.org:names:50981090-1,Cissus rotundifolia Lam.,"Royal Botanic Gardens, Kew","SEPASAL database. (RBG Kew, 1999)",Accepted
[2702692:2703043]urn:lsid:ipni.org:names:67922-1,Cissus rotundifolia Lam.,"Diazgranados, M., Allkin, B., Black, N., CΓ‘mara-Leret, R., Canteiro, C., Carretero, J., Eastwood, R., Hargreaves, S., Hudson, A., Milliken, W., Nesbitt, M., Ondo, I., Patmore, K., Pironon, S., Turner, R. & Ulian, T.","World Checklist of Useful Pl. Spp. (Diazgranados et al., 2020)",Accepted
At the other end, 9,874 of the 54,207 rows have an empty scientificName and are simply never indexed, which is where 54,207 β 9,874 = 44,333 comes from. The sorter puts them at the front, so the first 484,618 bytes of the CSV cannot be reached through this index by any query: the very first line of the SSTable is aaronsohnia factorovskyi warb. & eig[484618:484981]. There is also a smaller asymmetry I never fixed, which is that the indexer NFKD-normalises every term while the client only lower-cases and trims the query, so a name typed with a composed accent will not find its decomposed key.