.
D 2026-08-18T19:56:50.048
J cmimetype text/x-markdown
J comment Everything\sfleet-wide\stoday\swalks\severy\srepository.\sAt\s23\sstores\sthat\sis\sinvisible;\sit\sis\slinear,\sso\sit\sis\sa\swall\srather\sthan\sa\sslope.\n\nMeasured\snow,\sand\sthe\snaive\sextrapolation\sto\s10,000\sstores:\n\n|\ssurface\s|\s23\srepos\s|\s~10,000\s|\n|---|---|---|\n|\s`repo.list`\s|\s42\sms\s|\s~4\ss\s|\n|\s`people.list`\s|\s8\sms\s|\s~6.5\ss\s|\n|\s`search.all`\s|\s415\sms\s|\s~40\ss\s|\n\n`search.all`\sis\sthe\sworst\sbecause\seach\srepository\sis\sa\sseparate\sSQLite\sfile\sand\sa\sseparate\sFTS\squery.\sIt\sis\salso\sthe\sone\swith\sa\shard\sresource\sfloor:\s10,000\sopen\sdatabase\shandles.\n\n##\sWhat\shas\sto\schange\n\n1.\s**Paging,\severywhere.**\s`repo.list`\sreturns\severy\srepository\sand\sthe\slanding\spage\srenders\sall\sof\sthem.\sIt\sneeds\sa\scursor\sand\sa\spage\ssize,\sand\sthe\sfleet\sSSE\sstream\shas\sto\spage\swith\sit\sor\sa\srepaint\sre-sends\sthe\swhole\slisting.\n2.\s**Never\sopen\severy\sindex\sto\sanswer\sa\sfleet\squestion.**\s`people.list`\sand\sthe\stab\scounts\sshould\sread\sa\sfleet-level\srollup\sin\sthe\sforge\sOLTP,\srefreshed\son\singest,\srather\sthan\sfanning\sout\sper\srequest.\sThe\sper-repo\s`contributor`\stable\sis\salready\sthe\sright\sshape\sto\sroll\sup\sfrom.\n3.\s**Search\sneeds\sa\sdifferent\smechanism,\snot\sa\sbigger\sfan-out.**\sFan-out\swas\sthe\shonest\schoice\sat\sthis\ssize\sand\sit\sstays\scorrect,\sbut\spast\sroughly\s500ā1,000\sstores\sit\shas\sto\sbecome\sone\sshared\sindex.\sThat\sis\sthe\spoint\sat\swhich\sthe\scontentless-FTS\swork\sbecomes\sworth\sdoing\stoo,\ssince\sthe\sshared\sindex\sis\swhere\sthe\sduplicated\s`search_doc`\stext\swould\sotherwise\sbe\spaid\sfor\sagain.\n4.\s**Bound\sthe\shandles.**\sAn\sindex\shandle\sper\sserved\srepository\sis\sa\sfile\sdescriptor\sper\srepository\sheld\sopen\sforever.\sThat\sneeds\san\sLRU\sof\sopen\sindexes\swith\sthe\srest\sclosed.\n\n##\sOrder\n\nPaging\sfirst\sā\sit\sis\sthe\sonly\sone\sa\sreader\snotices\simmediately,\sand\sit\sis\scontained.\sThe\srollup\ssecond.\sThe\sshared\ssearch\sindex\slast,\sbecause\sit\sis\sthe\sone\sthat\schanges\sthe\sarchitecture\srather\sthan\sthe\squeries,\sand\sit\sshould\sbe\sdone\swith\sa\sreal\scorpus\sto\smeasure\sagainst\srather\sthan\sspeculatively.
J severity Important
J status Open
J title Fleet\ssurfaces\sare\sO(repos)\sand\swill\snot\ssurvive\sthousands\sof\sstores
J type Code_Defect
K fbe8dbfcc230b567da3d6a8da157cc68961d3761
U dmestas
Z bf071b65131e4e069559b8d3a3852bd1