Skip to content

Commit 745dcec

Browse files
authored
Create PostgreSQL.sql
1 parent 4090bfe commit 745dcec

File tree

1 file changed

+10
-0
lines changed
  • sql-queries-11/Most_Efficient_Way_to_Get_Table_Row_Count_in_SQL

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Analyzing the Department table
2+
3+
ANALYZE public.Department;
4+
5+
6+
-- Counting rows for Department table using pg_class
7+
8+
SELECT reltuples::BIGINT AS estimate
9+
FROM pg_class
10+
WHERE oid = 'public.Department'::regclass;

0 commit comments

Comments
 (0)