Bug 834957 - optimize first mediadb scan