Deleting Row Store Table Data When at the Memory Limit

If you are running near the memory limit, you may get ERROR 1712 indicating that you have exceeded the maximum_memory setting. Running delete from tableName; in this situation may also cause an ERROR 1712 for a large table because deleting data takes memory for each row you delete, while the transaction containing the delete operation is running. To work around this, you can repeatedly run a command that deletes a batch of rows. For example, you could delete the oldest 10000 rows, then next oldest 10000 rows, and so on, either by hand or in a loop using a stored procedure, until you have reduced memory usage sufficiently. DELETE with a LIMIT clause may be useful for the purpose of batching deletes. If you have no further need for the data, or you have another way to recover it, you can either truncate the table or drop the table, since truncate and drop operations do not take any extra memory per row.

Last modified: April 26, 2021

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK