on 2010 Oct 31 12:16 PM
The V12 Help says "Side effects - None", and while that may be true from a semantic point of view, I know for a fact it is not true from a performance point of view.
Also, I believe the effects on performance have evolved from release to release, AND that these effects are probably difficult to describe.
But please, someone take a shot (V12 only).
Justification: There are reasons, possibly not great reasons but reasons nonetheless, that someone may wish to issue an explicit CHECKPOINT. For example, SELECT count FROM SYSTAB is much faster than SELECT COUNT(*) but the value is only up-to-date after a checkpoint... as are other interesting counters in the system tables.
Also, folks might want to know what can happen when an automatic checkpoint occurs... all in one place in the docs (say, where the CHECKPOINT statement is described).
Request clarification before answering.
Remember, you asked for it...
Acquire the "checkpoint gate": ie, wait until a checkpoint can be performed (no backups in progress, etc) then prevent others from performing checkpoints.
Pre-flight for updates of system tables. Pre-flight means we reference all the pages we will need to update so that the pages are in cache and we won't need to wait from them to be read while running in exclusive mode.
Suspend deferred growth. This will wait for any deferred growth of dbspaces to complete
Pre-flight for update of orphaned blob information
Enter exclusive mode: no other tasks can be executing on the database after we enter exclusive mode. You may also have heard us call it "Forbid" mode -- named after an AmigaOS API which has a similar function
Display the "Starting checkpoint" message
Actually update system tables & orphaned blobs. System table updates include users (login failure attempts, last login time), tables (row counts, index info), sequences, and statistics
Log the checkpoint_begin in the redo log
Flush the checkpoint log
Write all dirty pages from cache
Update the checkpoint log to complete the checkpoint, update last checkpoint time, clear the "active" (aka "dirty") bits. After this step, the checkpoint has officially happened.
Log the checkpoint_end in the redo log
Display the "Finished Checkpoint" message
Truncate the redo log if using "-m"
Remove unreferenced entries from the identifier hash table
Purge any shared heaps (parsed proc definitions, etc) that are unreferenced but were held in cache because they had been referenced frequently
Coalesce the main heaps
Exit exclusive mode
Resume deferred growth feature
Release the checkpoint gate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Point 7 includes updating max_identity values, right? (And I love the AmigaOS reference - has it ever been a supported platform?)
Yes, point 7 includes updating the max_identity values. I'm pretty sure there was never an AmigaOS port of SQLAnywhere. That might be fun -- I wonder what state the tools are in 🙂 I was an Amiga programmer a long time ago and I still have my Amiga 1000 and 3000. I even had the A3000 running a few months ago and though it definitely felt foreign, it was surprising how quickly some of the AmigaDOS insanity came flooding back. Insanity such as "dir #?.c". Yeah, "#?" instead of "*". Strange, but it came back to me.
Who does trigger such background checkpoints - are these the automatic checkpoints the server issues when he thinks it's time to do so - in contrast to checkpoints done explicitly or implicitly by certain statements?
User | Count |
---|---|
61 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.