The following code calculates the total length of the index and assigns it to the variable TotalLen.
TotalLen := 0; with PSQLTable1 do for I := 0 to IndexFieldCount - 1 do Inc(TotalLen, IndexFields[I].DataSize);