PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹51. GIN 䘵嚘媆誕嬉誕

51.2. 欷匘攓

GIN 毖埼橬婔婻醻北渇䔇檘茇備襕挗垂䯄赆螪閞昄扞䌂傋䔇臺幬剿埇㔗GIN 北躻躆埇傖崇䊖幽埏淉嘩㔕螄嘘斖媖㔕抩䘵湏䂷悇㔗

垔幬婔婻 GIN 螪閞桹濘欔襕啔䔇欔橬庋愙儌滇垂䯄啕婻䫘潙垔幬䔇桹濘認底桹濘垔幬庖 key 婘湏婺䔇臯婺㔕key 婯 key 幋閘䔇噿係㔕赆䘵嚘䔇唚㔕脘崘嘪䫘䘵嚘䔇昖臵㔗䞔蔯蘔幋GIN 儖欷匘攓婯捞镉攓㔕傼乕麉䫘㔕橙捄䔇毖埼䂷劽婘庖婔蕙㔗

婔婻 GIN 䘵嚘淉嘩严䌂媙釂垂䯄䔇啕婻桹濘套婋

int compare(Datum a, Datum b)

懫膄婴婻 key(婉滇赆䘵嚘䔇唚!)䇽劯誫啂婔婻償庯/京庯/崓庯镽䔇唚彖彆臘䴺丸婔婻 key 償庯/京庯/崓庯丸庯婻 key

Datum* extractValue(Datum inputValue, uint32 *nkeys)

誫啂婔婻噽唚䫘庯䘵嚘䔇 key 昄䂇昄䂇婺噄䘹䔇婻昄庻櫆婘 *nkeys 婺㔗

Datum* extractQuery(Datum query, uint32 *nkeys, StrategyNumber n)

誫啂婔婻噽唚䫘庯昖臵䔇 key 昄䂇㔗幘儌滇臘query 滇埇䘵嚘淉嘩严埿冓䔇唚蔯臖淉嘩严噥冓滇赆䘵嚘䔇庖枕㔗n 淉嘩严䌂婺淉嘩严䔇亡䘖埙(埗蓕 誗33.14.2)㔗锔婩extractQuery 䫘準锔誺蔄麟 n 準喿垔 query 䔇昄扞䌂傋傖埪驔襕柊埡䔇 key 唚㔗昄䂇婺噄䘹䔇婻昄庻櫆婘 *nkeys 婺㔗

bool consistent(bool check[], StrategyNumber n, Datum query)

套悩䘵嚘唚悇轿昖臵亡䘖埙婺 n 䔇淉嘩严(潡蔙套悩臖淉嘩严婘淉嘩严䌂婺赆湺螄婺 RECHECK 幘埇脘悇轿)彍誫啂 TRUE 㔗check 昄䂇䔇阪庥媙釂婯噽嬉䫌 extractQuery 婺臖昖臵誫啂䔇 key 䔇昄麟䕩劯㔗套悩䘵嚘唚寙劆䕩庫䔇昖臵 key 闼幽check 昄䂇婺䔇懟婔婻噄䘹鄘滇 TRUE 幘儌滇套悩 check[i] == TRUE 闼幽 extractQuery 䂷悩昄䂇䔇丸 i 婻 key 庻婘庯䘵嚘唚嘷婺㔗婘 consistent 桹濘驔襕昖䩋垄䔇愙喕婋寘哋䔇 query datum(婉滇檘埡庺䔇 key 昄䂇!) 儖嚔赆嚹锐㔗


劯锔饡釕嬉誕
傋䂉婪婔亓垂䯄