Attempting to quickly open a huge table with FDTable

1
Hello, the problem I'm facing is: I have a table with 120,353 records I need to make a general correction on the table and how much do I try FDTable.Active := True gets in process endlessly ... I'm using FireBird 2.5 ... What to do?

table index

CREATE INDEX IDX_AND_PRO_AUX ON ANDAMENTOS_PROCESSUAIS(NUMERO_PROCESSO_AUX);

CREATE INDEX IDX_PUBLICACAO ON ANDAMENTOS_PROCESSUAIS(CODIGO_PUBLICACAO);

Would there be any way to open the table without loading all the records?

    
asked by anonymous 31.08.2017 / 23:27

2 answers

3

If you have grids associated with these FDTable , making disableControls() to 'cut' the table-grids connection before opening it usually speeds up a lot.

Something like:

FDTable.DisableControls;
FDTable.Open;
FDTable.EnableControls;

To do as you've been told to do, limit the number of registrations you bring each time in a FDTable you have to choose those options in the FetchOptions of FDTable . There are a number of parameters you can use to speed up reading the table, but in this case you would say that you need to edit Mode to fmExactRecsMax and edit the RecsMax value

But it is best to see the documentation in link

    
02.09.2017 / 01:03
2

If your goal is just to limit the number of records to open for example at 5000 you only need to use the following code:

SELECT FIRST 5000 * FROM tabela ORDER BY id DESC;

Unlike MySQL we can use Limit in FireBird here to use First .

FireBirdSQL

    
01.09.2017 / 10:35