Hi, > indeed SHUTDOWN COMPACT solves the problem.
I'm not sure if you understand how and when the database file shrinks. It's not so much related to temp tables. I will try to improve the documentation: SHUTDOWN COMPACT fully compacts the database (re-creating the database may further reduce the database size). If the database is closed normally (using SHUTDOWN or by closing all connections), then the database is also compacted, but only for at most the time defined by the system property h2.maxCompactTime (see there). So in your case, without SHUTDOWN COMPACT, the database size only shrink up to 48 MB because of the 1 second limit (I thought 2 seconds, but now I see it's just one second). Compacting the database file is a heavy operation: each page at the end of the file is moved to the first free slow. The temp tables are free blocks in the beginning / middle of the database file. > As I'm not that into Google Do you mean http://h2database.com/p.html ? I wrote this page, it not related or hosted on Google. > I just uploaded the test case to my > webspace: > http://phillnet.de/data/TestIndex.java Yes, I can reproduce it is 48 MB. That's what I would expect. I can do the same without using temp tables (using regular tables): * Create a table A and add a lot of data there * Create a table B and add many rows * Drop table A * Close the database Most likely the database file will be still very big, as it would be without dropping table A. Just because it's not fully compacted yet. Compacting takes time. Regards, Thomas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
