Skip to content

Commit 63e41bb

Browse files
committed
Move includes to where they are actually used
This will make it easier to keep these up to date when refactorings are done. Also sort them according to postgresql convention.
1 parent 78b0d1a commit 63e41bb

3 files changed

Lines changed: 39 additions & 35 deletions

File tree

hash_query.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*-------------------------------------------------------------------------
1616
*/
1717
#include "postgres.h"
18+
19+
#include "storage/ipc.h"
20+
#include "storage/shmem.h"
21+
#include "utils/memutils.h"
22+
1823
#include "pg_stat_monitor.h"
1924

2025
static pgsmLocalState pgsmStateLocal;

pg_stat_monitor.c

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,44 @@
1616
*/
1717

1818
#include "postgres.h"
19+
20+
#include <arpa/inet.h>
21+
#include <math.h>
22+
#include <sys/resource.h>
23+
#include <sys/time.h>
24+
25+
#include "access/hash.h"
1926
#include "access/parallel.h"
27+
#include "access/xact.h"
28+
#include "catalog/pg_authid.h"
29+
#include "commands/dbcommands.h"
30+
#include "commands/explain.h"
31+
#include "common/ip.h"
32+
#include "funcapi.h"
33+
#include "jit/jit.h"
34+
#include "mb/pg_wchar.h"
35+
#include "miscadmin.h"
2036
#include "nodes/pg_list.h"
21-
#include "utils/guc.h"
37+
#include "optimizer/planner.h"
38+
#include "parser/analyze.h"
39+
#include "parser/parsetree.h"
40+
#include "parser/scanner.h"
41+
#include "parser/scansup.h"
2242
#include "pgstat.h"
23-
#include "commands/dbcommands.h"
43+
#include "storage/ipc.h"
44+
#include "storage/proc.h"
45+
#include "storage/shmem.h"
46+
#include "tcop/utility.h"
47+
#include "utils/acl.h"
48+
#include "utils/builtins.h"
49+
#include "utils/lsyscache.h"
50+
#include "utils/memutils.h"
2451

2552
#if PG_VERSION_NUM >= 180000
2653
#include "commands/explain_state.h"
2754
#include "commands/explain_format.h"
2855
#endif
2956

30-
#include "commands/explain.h"
3157
#include "pg_stat_monitor.h"
3258

3359
/*

pg_stat_monitor.h

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,15 @@
1919

2020
#include "postgres.h"
2121

22-
#include <arpa/inet.h>
23-
#include <math.h>
24-
#include <sys/time.h>
25-
#include <sys/resource.h>
26-
27-
#include "lib/dshash.h"
28-
#include "utils/dsa.h"
29-
30-
#include "access/hash.h"
31-
#include "access/xact.h"
32-
#include "catalog/pg_authid.h"
3322
#include "executor/instrument.h"
34-
#include "common/ip.h"
35-
#include "jit/jit.h"
36-
#include "funcapi.h"
37-
#include "access/twophase.h"
38-
#include "mb/pg_wchar.h"
39-
#include "miscadmin.h"
40-
#include "optimizer/planner.h"
41-
#include "parser/analyze.h"
42-
#include "parser/parsetree.h"
43-
#include "parser/scanner.h"
44-
#include "parser/scansup.h"
45-
#include "pgstat.h"
46-
#include "storage/ipc.h"
23+
#include "lib/dshash.h"
24+
#include "nodes/nodes.h"
4725
#include "storage/lwlock.h"
48-
#include "storage/proc.h"
49-
#include "storage/shmem.h"
5026
#include "storage/spin.h"
51-
#include "tcop/utility.h"
52-
#include "utils/acl.h"
53-
#include "utils/builtins.h"
54-
#include "utils/memutils.h"
55-
#include "utils/timestamp.h"
56-
#include "utils/lsyscache.h"
27+
#include "utils/dsa.h"
5728
#include "utils/guc.h"
29+
#include "utils/hsearch.h"
30+
#include "utils/timestamp.h"
5831

5932

6033
/* XXX: Should USAGE_EXEC reflect execution time and/or buffer usage? */

0 commit comments

Comments
 (0)