What can speed up a SQL count query?
-
30-10-2019 - |
Вопрос
When doing a count (aggregate) SQL query, what can speed up the execution time in these 3 database systems? I'm sure many things could speed it up (hardware for one), but I'm just a novice DBA, so I'm sure I'll be getting a few answers here. I migrated about 157 million rows to a SQL Server database, and this query is taking forever. But in my source Netezza database, it takes seconds.
For example:
Netezza 6:
SELECT COUNT(*) FROM DATABASENAME..MYTABLE
Oracle 11g:
SELECT COUNT(*) FROM MYTABLE
SQL Server 2012:
SELECT COUNT(*) FROM DATABASENAME.[dbo].[MYTABLE]
Нет правильного решения
Не связан с dba.stackexchange