@mjd “Was the alphabetic index invented before the scroll was superseded by the codex?” — Not really. Plinius' “Natural History“ has an index and he tells in his preface about another work with an index, but that seem to be the only cases. The problem is that with a scroll, you cannot actually use the index, because “leafing” through the pages (or better, “scrolling”?) would be too much effort.
It is also said that the introduction of Christianity was the reason why in later times, codices were much more popular than scrolls. The problem was the Bible: To work as a theologian, you have jump backward and forward between gospel and prophet books, between different gospels, and so on — much too much work if you have scrolls. The Bible was the first hypertext!
For more about indices, see “Index, A History of the” by David Duncan (https://en.wikipedia.org/wiki/Index,_A_History_of_the).