I need to completely delete 1 table and start it's...
# ask-ai
s
I need to completely delete 1 table and start it's sync again. Deleting that table and it's equivalent temp table from airbyte_internal schema is enough? What is _airbyte_destination_state table does?_
u
To completely delete a table and restart its sync in Airbyte, simply deleting the table and its equivalent temp table from the airbyte_internal schema is not sufficient. Here's what you need to do: 1. Drop the final table you want to resync. 2. Unset the
_airbyte_loaded_at
column in the raw table:
Copy code
sql    UPDATE airbyte_internal.<your_raw_table> SET _airbyte_loaded_at = NULL
3. Run a new sync. This process will trigger a "soft reset" and recreate the final table with the correct data [Documentation > Using-airbyte > Core-concepts > Typing and Deduping > On final table re-creation](https://docs.airbyte.com/using-airbyte/core-concepts/typing-deduping#on-final-table-re-creation). Regarding the
_airbyte_destination_state
table, it's used to store the state information for each stream. The state helps Airbyte keep track of what data has been synced and allows for incremental syncs and checkpointing [Documentation > Understanding-airbyte > Airbyte Protocol > State & Checkpointing](https://docs.airbyte.com/understanding-airbyte/airbyte-protocol#state--checkpointing). As for the
_AIRBYTE_TMP
tables, they are temporary tables created during the sync process. While it's generally safe to delete them after a sync is complete, they should be automatically cleaned up by Airbyte [Forum Post: Is it okay to delete the _AIRBYTE_TMP tables?](https://discuss.airbyte.io/t/1388).
s
@kapa.ai I can delete table from airbyte_internal, no need to change any columns then?
u
I apologize, but I would not recommend deleting tables from the airbyte_internal schema or modifying its columns. Here's why: 1. The airbyte_internal schema contains important "raw" data tables that Airbyte uses to build and rebuild the final tables in your destination. As stated in a GitHub issue response, "we keep the 'raw' data, forever, in
airbyte_internal
, so we can rebuild the final tables with easy, adjusting schemas and types as needed" [Github Issue Comment](https://github.com/airbytehq/airbyte/issues/31660). 2. Modifying or deleting these raw tables could interfere with Airbyte's ability to properly sync and manage your data. The documentation notes that "We do not recommend directly interacting with the raw tables, and their format is subject to change without notice" [Databricks Lakehouse Output Schema](https://docs.airbyte.com/integrations/destinations/databricks#output-schema). 3. If you're concerned about temporary tables, it's worth noting that some temporary tables (with names like _AIRBYTE_TMP) are typically cleaned up automatically after a sync. If they persist, you can safely delete those specific temporary tables, but not the main raw data tables [Forum Post](https://discuss.airbyte.io/t/1388). 4. If you need to reset or recreate tables, Airbyte has built-in processes to handle this. For example, you can trigger a "soft reset" by following specific steps outlined in the documentation, rather than manually deleting tables [Typing and Deduping Documentation](https://docs.airbyte.com/using-airbyte/core-concepts/typing-deduping#on-final-table-re-creation). In summary, it's best to let Airbyte manage the airbyte_internal schema and its tables. Manually deleting or modifying these could lead to sync issues or data loss.