Subject Re: [firebird-support] Do global temporary tables have performance advantages over usual tables
Author Huan Ruan
> The question is - do global temporary tables have performance advantages
> over usual tables? And whether global temporary tables were designed with
> optimization goal in mind at all? Maybe they have different goals?
I don't think global temporary tables (GTT) is designed purely for
optimisation, but there can be some performance gains with using GTT.

1. Large deletion on usual tables can be very slow especially when there
are lots of non unique indexes, generates lots of garbage, and sometimes
can cause index corruptions as well. GTTs, especially transaction based
GTTs, don't have this problem because typically you don't need to do
deletion, The database engine just drops the whole instance of the GTT when
you finish your work.
2. GTT data (table data, index data and the related old versions and
garbage), is stored outside of the normal database file so doesn't bloat
the database size.
3. In Firebird 2.5, you can do writings to GTT within a read-only
transaction. This certainly improves performance. Read-only read committed
transactions do not interfere with transaction housekeeping, i.e. OIT and
4. Similar to the above point, I can imagine the database engine can
utilise the fact that GTT data has limited visibilities for more


> Reply via web post<;_ylc=X3oDMTJyY2JhOGNzBF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BG1zZ0lkAzEyMjQyNwRzZWMDZnRyBHNsawNycGx5BHN0aW1lAzEzNzU4MTU5ODM-?act=reply&messageNum=122427> Reply
> to sender
> <tom.rhodesw@...?subject=Re%3A%20Do%20global%20temporary%20tables%20have%20performance%20advantages%20over%20usual%20tables> Reply
> to group
> <> Start
> a New Topic<;_ylc=X3oDMTJlcGQxOGpoBF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTM3NTgxNTk4Mw--> Messages
> in this topic<;_ylc=X3oDMTM4ODVqbHJ0BF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BG1zZ0lkAzEyMjQyNwRzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzEzNzU4MTU5ODMEdHBjSWQDMTIyNDI3>(1)
> Recent Activity:
> - New Members<;_ylc=X3oDMTJmMDRhMDZhBF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzEzNzU4MTU5ODM-?o=6>
> 7
> Visit Your Group<;_ylc=X3oDMTJlYXJ0NW5hBF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTM3NTgxNTk4Mw-->
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Visit and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
> Also search the knowledgebases at
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> [image: Yahoo! Groups]<;_ylc=X3oDMTJkZG51djg2BF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMzc1ODE1OTgz>
> Switch to: Text-Only<>,
> Daily Digest<>�
> Unsubscribe<>� Terms
> of Use <> � Send us Feedback
> <>
> .

[Non-text portions of this message have been removed]