Best Practices for writing SQL Queries 👇💡

I'll add the No. 10) create parametrized stored procedures for common units of logic which can be reused.

#sql #data #databases

Follow

@omartwotone

I would add to that:
beware of the catastrophic effect a 'group by' can have if your query contains cascading Views (or CTEs).

The query optimizer of many DBs is capable of pushing the predicate down through a series of nested Views (or CTEs) but that process is immediately blocked by a 'group by' in the cascade.

Certainly, that was the case with the Oracle optimizer up to version 11

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.