SQLContainer.indexOfId() also searches backwards (#11849, #10376)

Change-Id: Iea3f832cd50314f747b82b774c3be57797f9ac1d