Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    Getting StartedAdministrator documentationFunctional characteristics
      Technology descriptionarrow
    • Architecture OverviewComponent Description
        Deployment schemesarrow
      • Basic schemeFail-safe schemeTypical Placement in Infrastructure
    System requirements
      Admin Panelarrow
      • Account areaarrow
        • Accountsarrow
        • Account UsersAccount Virtual SendersAccount Database Indexes
        TariffsExternal data configurationLDAPTasksSchedule JobsGlobal Stop ListsWebversion Store Policies
        Settingsarrow
      • Databases
          Accessarrow
        • AdminsAPI tokens
        Notifiers
          MTAarrow
        • Default rulesRetry rulesLock rulesBounce patternsStrategiesKeysISPsPools
      Nodes
        Sendersarrow
      • EmailSMSEvent generatorIntegration with SendsayENS: настройка сендера
        Reportsarrow
      • Audit JournalData Usage
        Toolsarrow
      • ARF decoderURL decoderSMID decoderLicense
      Platform installationarrow
    • Automatic installationManual installationRunning the platform in a Docker container
      Platform configurationarrow
    • Configuration fileDomain settingsLDAP access configurationSending Email via SMTP relayPixel and push domain configurationCluster and Replication SetupSystem notifications configurationProcesses UNIX sockets configurationHTTPS ConfigurationMigrating from MongoDB Community Edition to Percona Server for MongoDBAdding sender IP addressesDeduplication request settingsPostgreSQL database for account dataProxy server settingsKeycloak Integration with AltcraftGetting HTTP service statusesConfiguration MongoDB logs rotation
        Configuration of system constants and directoriesarrow
      • Filtering bot actionsDirectory of gender markers
      Platform maintenancearrow
    • Personnel requirementsPlatform maintenance processesPlatform updatingPlatform service monitoringBackup and recoveryTransferring the platform to a new serverCreating, deleting, and populating tables for statistics in ClickHouseUsage of the aktool utilityUsers and directories engaged by the platform
      Custom channels guidearrow
    • OverviewCreating and configuring a channelEntity field configurationTemplate languageEntities
        Pipesarrow
      • Pipe: Basic ConceptsResultErrorsLogPackUnpackHTTP RequestStore SetStore GetSelectorSQLEventerScheduler
        Pipelinesarrow
      • Pipeline: Basic ConceptsMessageScheduleListenerModerateStop
      Extraarrow
    • System page customizationSend Message IDИнструкция по миграции истории в ClickHouseInstructions for migrating history to ClickHouseUtility for importing push subscriptions to Firebase projectUtility for importing push subscriptions to Firebase project
    Processing HTTP/HTTPS traffic
      Administrator APIarrow
      • Accounts admin apiarrow
        • Restricted accessarrow
        • Account Activation and DeactivationAccount Freeze and Unfreeze
        Get accounts listAdd a new accountDelete the account
        Account usersarrow
      • Update an Existing AccountAdd a new accountDelete a userGet a list of usersSending a Welcome Email
        Nodesarrow
      • Synchronize node MTA configurationGet nodes listGet node MTA statusActivate node MTADeactivate node MTA
        Senders admin apiarrow
      • Create or update AKMTA senderGet AKMTA sender informationAssign account to senderGet senders listDelete senderRestore sender
          Sender queuearrow
        • Get sender queue informationHold sender queueRelease sender queueClear sender queue
        Virtual sendersarrow
      • Get virtual senders listGet virtual sender informationCreate virtual senderUpdate virtual senderClone virtual senderDelete virtual sender
    Documentation Archive
  • Platform maintenance
  • Creating, deleting, and populating tables for statistics in ClickHouse

Creating, deleting, and populating tables for statistics in ClickHouse

In some cases, such as when setting up a replicated cluster, you may need the function to create empty tables with a replicated engine to properly move data from regular tables later on. You can create and delete tables for storing statistics, or populate data (based on triggers in MV) using the aktool utility.

Command reference​

aktool utility commands:

Init stat table.

Usage:
aktool stats init [summary|pixel|engagement|click_map|forms|undelive|mailings|notify|channel|all] [flags]

Flags:
-h, --help help for init

Global Flags:
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output

Prameters of commands​

List of parameters (tables) for delete, fill, init commands:

ParameterTableDescription
allAll tables for storing statistics
summarysummary_report
summary_MV_%версия
Summary report
pixelpixel_report
pixelUndefMV_%версия
pixelMV_%версия
Pixels
engagementengagement_report
engagement_MV
Audience growth report
click_mapclick_map_report
click_mapMV
Click map
formstotal_form_report
formMV

form_pages_view_report
form_pages_viewMV

group_form_report
group_formMV
Forms
undeliveundelive_report
undeliveMV
Undelivered report
campaignscamp_statsReal-time mailing statistics
notifynotify_sender_statsDaily and weekly user reports

Create table​

Create tables for the summary report:

./aktool stats init summary

Create all necessary tables for storing statistics:

./aktool stats init all

Population table​

Populate tables for forms:

./aktool stats fill forms

Populate all necessary tables for storing statistics:

./aktool stats fill all

Delete table​

note

To fully delete a replicated table, you need to wait until the table data is removed from ZooKeeper. The waiting time can be configured using the parameter database_atomic_delay_before_drop_table_sec in the ClickHouse server configuration.

Delete tables for undelivered report:

./aktool stats delete undelive

Delete all necessary tables for storing statistics:

./aktool stats delete all
Last updated on Mar 12, 2026
Previous
Transferring the platform to a new server
Next
Usage of the aktool utility
  • Command reference
    • Prameters of commands
  • Create table
  • Population table
  • Delete table
© 2015 - 2026 Altcraft, LLC. All rights reserved.