Обсуждение: A small performance bug in BTree Infrastructure

Поиск
Список
Период
Сортировка

A small performance bug in BTree Infrastructure

От
"Gokulakannan Somasundaram"
Дата:
Hi All,<br />       BTree Insert requires a data-structure called BTStack to report the page splits that have happened
inthe leaf pages to non-leaf pages upwards. It basically goes back and updates those non-leaf pages. But this will
neverhappen in a search operation. You never need to climb upwards for a  Select statement. Actually we can clearly see
thatin the _bt_first function, as soon as we complete calling _bt_search, we call _bt_freestack to free it. So
unnecessarilya BTStack structure is getting formed and deleted.<br />        Inside _bt_search function, if we just add
aif condition to check whether access is for BT_READ, then we can avoid the creation of stack and also remove the
_bt_freestack in the _bt_first function. I just implemented the change and tested it and i am not seeing any
performancedifference(as expected).<br />        <br />        Still i thought of reporting it, so that whoever is
workingon it, can incorporate this change also.<br /><br />Thanks,<br />Gokul.<br />