On 5-9-2013 18:02, Ann Harrison wrote: > A major goal for Firebird's indexes was to minimize index locking and > allow pages to be added to and dropped from indexes without blocking > index reads. There's a long paper on the IBPhoenix web site that > explains exactly how that works. The summary is that during index > modifications, the forward pointers between pages in an index are always > correct, but the back pointers are not guaranteed. It's a classic > careful write problem - A points to C and C points to A and you want to > stick B in between them. You set up B correctly, so it's got a forward > pointer to C and a backward pointer to A, then change A so it points > forward to B rather than C. Until you rewrite C so it points backward > to B rather than A, a backward scan is going to miss B.
I wonder though, when you are following the back pointers couldn't this be solved by checking the forward pointer from the 'current' page to see if it points back to your 'previous' page? And when it doesn't, you follow the forward pointers back to your 'previous' page adding those pages to a stack, and when you reach the 'previous' page then you process the page pages from the stack and start reading again from the 'current' page? Mark -- Mark Rotteveel
