# Optimizing the Casts Away

DevFeed: [Optimizing the Casts Away](<https://devfeed.tech/articles/optimizing-the-casts-away-8616.md>)

Original publisher: [Read original article](<https://trino.io/blog/2019/05/21/optimizing-the-casts-away.html>)

Author: Martin Traverso

Published: 2019-05-21T00:00:00Z

Content type: article

Language: en

Sources: [Trino Blog](<https://devfeed.tech/sources/trino-blog.md>)

Topics: [Optimization](<https://devfeed.tech/topics/optimization.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Query (disambiguation)](<https://devfeed.tech/topics/query.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [expression](<https://devfeed.tech/tags/expression.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [sql](<https://devfeed.tech/tags/sql.md>), [types](<https://devfeed.tech/tags/types.md>)

## AI overview

This article explains a new optimization in Presto 312 that removes unnecessary explicit casts introduced by users or by the query planner. It describes how implicit type conversions are represented during planning, why casts complicate predicate pushdown and execution, and how constant expressions can be precomputed to avoid repeated conversions.

## Source excerpt

The next release of Presto (version 312) will include a new optimization to remove unnecessary casts which might have been added implicitly by the query planner or explicitly by users when they wrote the query.