Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

When you execute a SQL SELECT Count or Count Distinct on a database is the data still loaded into memory?

When executing a SQL SELECT COUNT x statement is the data loaded into memory and then counted or is the count done in the DB and then returned?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Count is done in the DB and then returned to QV.

View solution in original post

2 Replies
swuehl
MVP
MVP

Count is done in the DB and then returned to QV.

matthieu_burel
Luminary Alumni
Luminary Alumni

Only the result of the request is loaded in memory.

Consequently, a "select *" will load all data of the DB table while "select count(*)" will just the load the result of the count.