Hector Clarke - recently retired Deputy Chief Constable of the Lothian and Borders force - told the court he was appointed to lead the inquiry and co-ordinate the work of the six police forces that had been investigating the kidnap and murder of Susan Maxwell, 11, Caroline Hogg, 5, and Sarah Harper, 10, between 1982 and 1986.
Mr Clarke said Britain had not seen a more extensive criminal investigation and so much information was collected that police had to take over two floors and a basement in Newcastle upon Tyne to store 22 tons of material.
Robert Black, 47, a delivery driver, of Stamford Hill, north London, denies 10 charges relating to the kidnap and murder of the girls. He also denies a further charge of kidnapping.
Under cross-examination by Ronald Thwaites QC, defending Mr Black, Mr Clarke agreed that he had been concerned during the inquiry that when the investigation was completed the police would discover that the man they charged had figured in their files and not been identified as a prime suspect.
However, the first time Mr Black came into the inquiry was when he was arrested in July 1990. The jury was told that Mr Black had appeared before an Edinburgh court in August 1990 and pleaded guilty to abducting a child.
The prosecution has concluded its case and Mr Black will begin his defence when the trial resumes next week.