2004-11-01から1ヶ月間の記事一覧

CritSectionCount

クリティカルセクションカウンタ START_CRIT_SECTION()マクロで,クリティカルセクションの開始。 (CritSectionCountをインクリメント) END_CRIT_SECTION()マクロで,クリティカルセクションの終了。 (CritSectionCountをデクリメント) マクロを使わず,Crit…

libpq.dll

libpq.dllで検索SQLを実行して検索結果を取得するとき,getAnotherTuple()に負荷が集中する。 getAnotherTuple()の中で負荷が高い場所は,for (i = 0; i pqGetInt()は,引数にバイト数(2 or 4)を渡すようになっており,pqGetInt()内部でswitch文で処理を分け…

tupleのinsert/update/delete

・insertの処理 insertは,ExecProcNodeで新しいタプルを作成後,ExecInsertでタプルをinsertする。 ExecutePlan ExecProcNode ExecResult ExecProject ExecTargetList ExecStoreTuple ExecInsert ExecConstraints heap_insert RelationGetBufferForTuple Re…

libpq

・pqformat.c: pq_beginmessage() initStringInfoでbufを初期化する buf->cursorにmsgtypeをセット・pqformat.c: pq_sendint() 送信バイト数で処理を振り分ける。 appendBinaryStringInfo()でbufに追加する。・pqformat.c: pq_sendcountedtext() pg_server_t…

fmgr

・fmgr.c: fmgr_info_cxt() 関数のOidから,関数の情報(FmgrInfo構造体)を取得する。 fmgr_info_cxt_security()を実行している。・fmgr.c: fmgr_info_cxt_security() 最初にfinfoをinvalidデータで初期化する。 fmgr_isbuiltin()でbuiltin functionかチェッ…

pqResultAlloc()

pqResultAlloc()は,libpqで検索結果を保存するときのメモリを確保する。pqResultAlloc()は,PGRESULT_DATA_BLOCKSIZEで指定されている大きさのメモリブロックを確保して,PGresultのcurBlockに線形リストで管理する。 ブロックの割り当て済みのoffsetと空き…

node

・nodes.h: makeNode(_type_) nodeを作成するマクロ。 newNode()を実行する。 makeNode(Var)とすると,((Var *)newNode(sizeof(Var), T_Var))に展開される。・node.h: newNode(size, tag) 指定したsizeのメモリをpalloc0fast()で確保して,typeフィールドに…

printtup()

検索結果を出力する。 heap_deformtuple()でカラムごとのデータに分割して,FunctionCall3()でtextへ変換後,pq_sendcountedtext()で出力する。