Firebird 3.0.6 - embedded. Change the disk to caching tables the first time you start program

35 views
Skip to first unread message

Stanislav Hruška

unread,
Oct 4, 2020, 6:44:40 AM10/4/20
to firebird-support
The first time you run it, the tables are cached to hard disk. The disk is determined by where the DB itself is located. For me D: \ ... - HDD (~ 3 min.)
I'd like to change that. I want to have caching on disk C - SSD (<10 sec)
I'm not doing well at all. Using firebird.conf (TempDirectories = c: \ temp) does not help.

Dimitry Sibiryakov

unread,
Oct 4, 2020, 6:46:51 AM10/4/20
to firebird...@googlegroups.com
04.10.2020 12:35, Stanislav Hruška wrote:
> The first time you run it, the tables are cached to hard disk.

Firebird itself does not do anything like that.

--
WBR, SD.

Mark Rotteveel

unread,
Oct 4, 2020, 6:47:17 AM10/4/20
to firebird...@googlegroups.com
Tables aren't 'cached' on disk, the TempDirectories setting only affects
temporary files, eg for sorting large result sets.

Tables are *stored* in the database file, so if your database file is on
D:\, then the tables are on D:\.

Mark
--
Mark Rotteveel

Stanislav Hruška

unread,
Oct 4, 2020, 6:57:59 AM10/4/20
to firebird-support
Um, that's what I was told.
Then please explain the behavior of the application. Delhpi 10.4.1 - FireDAC
            first run -      next
HDD    ~ 3 min      <10 sec
SSD     <10 sec     <10 sec

The main table has almost 3.5 million records. There is a link to other tables.

Dátum: nedeľa 4. októbra 2020, čas: 12:47:17 UTC+2, odosielateľ: ma...@lawinegevaar.nl

Mark Rotteveel

unread,
Oct 4, 2020, 6:59:31 AM10/4/20
to firebird...@googlegroups.com
On 04-10-2020 12:56, Stanislav Hruška wrote:
> Um, that's what I was told.
> Then please explain the behavior of the application. Delhpi 10.4.1 - FireDAC
>             first run -      next
> HDD    ~ 3 min      <10 sec
> SSD     <10 sec     <10 sec
>
> The main table has almost 3.5 million records. There is a link to other
> tables.

Told by whom about what? In any case, maybe you're thinking about the
filesystem cache which happens *in memory*.

Also, with those stats, where is the *database file*?

Mark
--
Mark Rotteveel

Dimitry Sibiryakov

unread,
Oct 4, 2020, 6:59:49 AM10/4/20
to firebird...@googlegroups.com
04.10.2020 12:56, Stanislav Hruška wrote:
> Then please explain the behavior of the application. Delhpi 10.4.1 - FireDAC

Use Resource Monitor and/or Process Monitor to find out what is really happening.

--
WBR, SD.

Stanislav Hruška

unread,
Oct 4, 2020, 7:07:31 AM10/4/20
to firebird-support
Told by whom about what?
About caching tables on disk.
The DB is always on the disk to which the specified times belong.
I'll try those monitors

Dátum: nedeľa 4. októbra 2020, čas: 12:59:49 UTC+2, odosielateľ: sd

Mark Rotteveel

unread,
Oct 4, 2020, 7:38:51 AM10/4/20
to firebird...@googlegroups.com
On 04-10-2020 13:07, Stanislav Hruška wrote:
> Told by whom about what?
> About caching tables on disk.

Think about: tables are saved in a database, on-disk. Why would the
tables then be cached again on disk?

> The DB is always on the disk to which the specified times belong.

So, if you want that performance, then the database needs to be on that
disk. This hasn't got to do with caching tables in a temporary directory
(as Firebird doesn't do that).

Mark
--
Mark Rotteveel

Stanislav Hruška

unread,
Oct 4, 2020, 7:46:47 AM10/4/20
to firebird-support
So I'll try differently:
Why does the application run for 3 min when first launched from Delhi.
Then always only 10 sec.
If I restart Delphi, it starts again for 3 min.
Because FireDAC?

Dátum: nedeľa 4. októbra 2020, čas: 13:38:51 UTC+2, odosielateľ: ma...@lawinegevaar.nl

Stanislav Hruška

unread,
Oct 4, 2020, 7:48:58 AM10/4/20
to firebird-support
Those 3 minutes are valid even if I run the exe directly

Dátum: nedeľa 4. októbra 2020, čas: 13:46:47 UTC+2, odosielateľ: Stanislav Hruška

Mark Rotteveel

unread,
Oct 4, 2020, 7:58:01 AM10/4/20
to firebird...@googlegroups.com
On 04-10-2020 13:46, Stanislav Hruška wrote:
> So I'll try differently:
> Why does the application run for 3 min when first launched from Delhi.
> Then always only 10 sec.
> If I restart Delphi, it starts again for 3 min.
> Because FireDAC?

It could be that Delphi is slow to load your application on HDD, or it
could have to do with the filesystem cache caching the database file *in
memory*, or with the Firebird page cache caching the most relevant
database pages *in memory*. Most of those caches are released when your
application exits, and then need to be repopulated when the application
starts again.

Mark
--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages