1
votes

I am working on Delphi XE6 project. I am using Firedac for PostgreSQL connection.

There are two datamodules in this project and there are almost 20 TFDtables components on these data modules.

On create event of datamodules I am doing "TFDtable.open" for all tables. These tables contains lots of data say 700000 to 800000 entries.

Issue is with loading of data. It takes atleast 20 sec to load Is there any other way out to make it faster?

1
Are you loading these large numbers of rows just so that users can browse them in your gui? Anyway, I doubt you'll make opening these tables much faster. Far better would be to be much more selective about which records you load. That's a matter of application- and database-design. - MartynA
How is FetchOptions.Mode set in those FDTables? - Uwe Raabe
Even though FireDAC can help you here, I fully agree with @MartynA about fetching so many rows. It's just a pointless wasting of resources to fetch such amount of data. - Victoria

1 Answers

1
votes

It seems that you're implementing so called Live Data Window Mode, and you are looking for the LiveWindowFastFirst property. It is described as:

LiveWindowFastFirst

If it is set to True, then FireDAC builds a query to return the first results as fast as possible. If it is set to False (the default value), then FireDAC minimizes the time to return all table rows.

So try to enable it:

...
FDTable1.FetchOptions.LiveWindowFastFirst := True;
FDTable1.Open;