firedac fdtable延迟打开/获取记录

发布于 2025-01-31 22:41:43 字数 601 浏览 1 评论 0原文

由于某种原因,我需要在Delphi项目中使用FDTable来获取大量记录(InterBase数据库),不幸的是,以便打开FDTable需要太多时间(最多2分钟,有时甚至更多),甚至更糟,甚至更糟,甚至更糟,我在应用程序时,我通过更改获取选项来尝试所有可能的可能:recsmax,rowsize,mode等。如某些页面上提到的那样,例如: https://docwiki.embarcadero.com/radstudio/sydney/sydney/en/fetching_rows_(firedac)

将recsmax选项设置为小价值(50或100)性能,但即使使用Fetchall应用过滤器,它也不会获取1个记录。 正如我在需要使用fdtable进行此操作之前提到的那样,fdquery不是一个选择,因为我们都知道处理查询更好。

是否有建议可以平稳打开和获取数据(100k+记录)? 可以使用Filter + RecSmax获取记录吗?

For some reason, I need to use FDTable in a Delphi Project to Fetch a large number of records (Interbase Database), unfortunately, to open the FDTable takes too much time (up to 2min and sometimes more) even worse when to ApplyUpdate, I tried everything possible by changing the fetch options: Recsmax, Rowsize, Mode, etc. as mention on some pages, Like: https://docwiki.embarcadero.com/RADStudio/Sydney/en/Fetching_Rows_(FireDAC)

Set the RecsMax Option to a small value (50 or 100) helps a lot with the performance but it will not fetch 1 record with Filter applied even with FetchAll.
As I mention before I need to do this with FDtable, FDQuery is not an option as we all know dealing with queries is better.

Is there a recommendation to smoothly open and fetch the data (100k+ records)?
It's Possible to fetch records with Filter + RecsMax?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

残月升风 2025-02-07 22:41:43

查询表必须具有主键。
您可以按照以下方式配置tfdtable,

  FDTable1.FetchOptions.Items := [fiMeta];  // at least
  FDTable1.FetchOptions.Unidirectional := False;
  FDTable1.FetchOptions.CursorKind := ckAutomatic; // or ckDynamic
  FDTable1.CachedUpdates := False;
  // LiveWindowParanoic
  // When it is false there are problems with Locate and Recno
  FDTable1.FetchOptions.LiveWindowParanoic := False // Play with True/False.

这是最佳性能的配置

The query table must have Primary key.
You can configure TFDTable as follows

  FDTable1.FetchOptions.Items := [fiMeta];  // at least
  FDTable1.FetchOptions.Unidirectional := False;
  FDTable1.FetchOptions.CursorKind := ckAutomatic; // or ckDynamic
  FDTable1.CachedUpdates := False;
  // LiveWindowParanoic
  // When it is false there are problems with Locate and Recno
  FDTable1.FetchOptions.LiveWindowParanoic := False // Play with True/False.

This is the configuration for the best performance

一桥轻雨一伞开 2025-02-07 22:41:43

FDTable组件主要用于BDE兼容性。

fdquery带有“从table1”选择 *与使用fdtable完全相同,但是您可以在服务器端过滤结果集。

100k+记录是很多要传输的数据,Blobs添加了额外的开销,因为它们通常是单独获取的。
我建议您重新考虑功能设计。

FDTable component is there mainly for BDE compatibility.

FDQuery with "select * from Table1" is exactly the same thing as using FDTable, but you can filter resultset on server side.

100k+ records is a lot of data to transfer, blobs add additional overhead, as they're usually fetched separately.
I suggest you rethink the functionality design.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文