Permalink
Browse files

Increase allowed size of table from 1g to 5g for fetching number of s…

…ame values in quick filter menu, if that column is indexed.
  • Loading branch information...
ansgarbecker committed Jan 24, 2019
1 parent 28154aa commit 420c69fd35d706e6c6a071e141d6ffab635ed885
Showing with 7 additions and 0 deletions.
  1. +7 −0 source/main.pas
@@ -6604,6 +6604,7 @@ procedure TMainForm.QFvaluesClick(Sender: TObject);
i: Integer;
MaxSize: Int64;
ValueList: TStringList;
ColumnHasIndex: Boolean;
begin
// Create a list of distinct column values in selected table
for i:=QFvalues.Count-1 downto 1 do
@@ -6618,6 +6619,12 @@ procedure TMainForm.QFvaluesClick(Sender: TObject);
DbObj := ActiveDbObj;
Conn := DbObj.Connection;
MaxSize := SIZE_GB;
ColumnHasIndex := DataGridResult.ColIsKeyPart(DataGrid.FocusedColumn)
or DataGridResult.ColIsUniqueKeyPart(DataGrid.FocusedColumn)
or DataGridResult.ColIsPrimaryKeyPart(DataGrid.FocusedColumn);
if ColumnHasIndex then begin
MaxSize := MaxSize * 5;
end;
if DbObj.Size < MaxSize then begin
Query := Conn.QuoteIdent(Col)+', COUNT(*) AS c FROM '+DbObj.QuotedName;
if SynMemoFilter.Text <> '' then

0 comments on commit 420c69f

Please sign in to comment.