blob: a2f51570a1619c9f6c24a0a3487fd0c8b7caa7d0 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="delete_stats_in_truncate">
<title>DELETE_STATS_IN_TRUNCATE Query Option</title>
<titlealts audience="PDF"><navtitle>DELETE STATS IN TRUNCATE</navtitle></titlealts>
<prolog>
<metadata>
<data name="Category" value="Impala"/>
<data name="Category" value="Impala Query Options"/>
<data name="Category" value="Troubleshooting"/>
<data name="Category" value="Querying"/>
<data name="Category" value="Developers"/>
<data name="Category" value="Data Analysts"/>
</metadata>
</prolog>
<conbody>
<p>
This query option <codeph>DELETE_STATS_IN_TRUNCATE</codeph> can be used to delete or retain
table statistics. The default value of this option is 1 or true which means table statistics will
be deleted as part of truncate operation. However the default may not be an ideal solution in
case of non-transactional tables when the table and column statistics for the table are also
deleted by default. This can be an expensive operation especially when many truncate table
commands are running concurrently. In cases where truncate operation is used to remove the
existing data and then reload new data, it is likely that you will compute stats again as soon as
the new data is reloaded. This would overwrite the existing statistics and hence the additional
time spent by the truncate operation to delete column and table statistics becomes obsolete. To
avoid this expensive operation and to improve performance, you can set this query option to false
or 0. When set to false, a truncate operation will not delete the table and column statistics for
the table.
</p>
<p>
<b>Type:</b><codeph>BOOLEAN</codeph>; recognized values are 1 and 0, or true and false;
</p>
<p>
<b>Default:</b><codeph>TRUE</codeph> (shown as 1 in output of SET statement).
</p>
<p><b>Added in:</b>
<keyword keyref="impala40"/></p>
</conbody>
</concept>