New answers tagged

4 votes

Define a function on the fly as with CTE in MySQL

No it's not possible. Also it's generally better to avoid function use, especially in predicates, in a relational language like SQL, mostly from a performance perspective. Instead what you can do is ...
user avatar
  • 25.5k
6 votes
Accepted

How to pass the current row to Generated Column function in Postgres?

This doesn't seem possible. If it did work, it could only work by first creating the table, then the function, then adding the generated column. However, doing that: CREATE TABLE people ( id int, ...
user avatar
2 votes

Why are scalar functions special? A case study of trying to understand database terminology as a beginner

Why are scalar functions special? A scalar functions is just a function that returns a "scalar" value, i.e. a single value; not a pair/tuple (record) or set of tuples (i.e. a relational ...
user avatar
  • 2,864
2 votes

Why are scalar functions special? A case study of trying to understand database terminology as a beginner

Scalar is just one type of functions a database can have. For example, in Postgres, in addition to a scalar function, one can define a function that returns a record (a tuple of scalars) and a ...
user avatar
  • 22k
14 votes
Accepted

Why Does SQL Server Track Time Accurately For Some Multi-Statement Table-Valued Function Query Plans, And Not Others?

This is a consequence of using interleaved TVF execution. Interleaved execution changes the unidirectional boundary between the optimization and execution phases for a single-query execution and ...
user avatar
  • 72.1k
-4 votes

Why Does SQL Server Track Time Accurately For Some Multi-Statement Table-Valued Function Query Plans, And Not Others?

Tracking time in parallel executions (exchange operators and child threads) isn't trivial, and can't actually be accurate with current implementation. The other plan is serial, so easy to track ...
user avatar

Top 50 recent answers are included