Menu

#134 Too Many Queries : select pc.relname, pns.nspname, pa.attnum

7.1.4-Stable
closed
None
2016-02-24
2015-10-20
No

zDbcProgresql.pas send too many queries like that : select pc.relname, pns.nspname, pa.attnum.......

we could improve like that :

function TZPGTableInfoCache.GetTableInfo(const TblOid: Oid;
CurrentFieldCount: Integer): PZPGTableInfo;
var Idx: Integer;
begin
Idx := GetTblPos(TblOid);
if (Idx = -1) then
if (TblOid <> InvalidOid) and (LoadTblInfo(TblOid, Idx, nil)) then
Result := @FTblInfo[Idx]
else
Result := nil
else
begin
Result := @FTblInfo[Idx];
// !!NR le 20.10.2015
// Nothing change If Query Or Table Fields Count <> From TblInfo.FieldCount

//if Result^.ColCount <> CurrentFieldCount then //something changed ?
//  LoadTblInfo(TblOid, Idx, Result); //refresh all data

end;
end;

Best regards.
Rolland N.

1 Attachments

Discussion

  • EgonHugeist

    EgonHugeist - 2015-12-20
     
  • EgonHugeist

    EgonHugeist - 2015-12-20
     
  • EgonHugeist

    EgonHugeist - 2016-02-24
    • status: open --> closed
    • assigned_to: EgonHugeist
     
  • EgonHugeist

    EgonHugeist - 2016-02-24

    Detailed info and solution written in Ticket#120

     

Log in to post a comment.