implement common prefix search from compilation database