Hi,

Your analysis is not correct. 2000 is the initial wait time (in number of
changes), since starting the database. As documented, "The time between
running ANALYZE doubles each time since starting the database". So it's
2000, 4000, 8000, 16000,...

Regards,
Thomas


On Wed, Jan 4, 2017 at 7:42 PM, Noel Grandin <[email protected]> wrote:

> thats a good point, please log an issue for that
>
> On 4 January 2017 at 19:15, Uli <[email protected]> wrote:
>
>> Today I made a stacktrace while a very long operation was running in my
>> H2 db. The operation is a big delete (several million rows).
>>
>> I wondered about the following parts of the stacktrace (H2 1.4.191):
>> ...
>> at org.h2.table.RegularTable.analyzeIfRequired(RegularTable.java:433)
>>
>> at org.h2.table.RegularTable.removeRow(RegularTable.java:409)
>> at org.h2.command.dml.Delete.update(Delete.java:94)
>> at org.h2.command.CommandContainer.update(CommandContainer.java:98)
>> at org.h2.command.Command.executeUpdate(Command.java:258)
>> ...
>>
>> As far as I understand: On a delete statement H2 performs an analyze of
>> the table each time after N rows have been removed.
>> So when deleting 1 million rows and the analyze threshold (ANALYZE_AUTO)
>> is 2000, H2 will run 1 mio / 2000 = 500 analyze runs while executing the
>> delete statement.
>>
>> Is that correct? Wouldn't it be better to run analyze only once after the
>> full statement has been executed?
>>
>> Uli
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to