Recent

Author Topic: (SOLVED) Speed up a dbgrid with so many lines  (Read 2013 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2090
    • Lazarus and Free Pascal italian community
(SOLVED) Speed up a dbgrid with so many lines
« on: August 10, 2017, 08:53:28 pm »
Hi guys, I have a dbgrid that must display 10000 records. But it is very slow (over ten seconds). Is there any parameter that can speed up loading? Something that just loads me a few records at a time based on the scrollbar?

Thank you
« Last Edit: August 10, 2017, 09:48:12 pm by xinyiman »
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Handoko

  • Hero Member
  • *****
  • Posts: 3631
  • My goal: build my own game engine using Lazarus
Re: Speed up a dbgrid with so many lines
« Reply #1 on: August 10, 2017, 09:34:39 pm »
I remember there was a discussion about big database, maybe you will be interested:
http://forum.lazarus.freepascal.org/index.php/topic,37183.msg249430.html

xinyiman

  • Hero Member
  • *****
  • Posts: 2090
    • Lazarus and Free Pascal italian community
Re: Speed up a dbgrid with so many lines
« Reply #2 on: August 10, 2017, 09:42:02 pm »
I solved with

TZQuery.FetchRow:=10;

It was really trivial! Sorry
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

mangakissa

  • Hero Member
  • *****
  • Posts: 1086
Re: (SOLVED) Speed up a dbgrid with so many lines
« Reply #3 on: August 11, 2017, 08:28:58 am »
Or use TSQLQuery.Disablecontrols and TSQLQuery.Enablecontrols
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

 

TinyPortal © 2005-2018