中断耗时过长的 SQL 查询是否会导致磁盘空间减少?

中断耗时过长的 SQL 查询是否会导致磁盘空间减少?

对于个人数据分析项目,我尝试通过自连接(两次)来找到最常一起销售的 3 种产品。

由于查询耗时超过 15 分钟,而且笔记本电脑风扇似乎超速运转,我决定停止查询。这一切都是通过 pgAdmin 完成的。

随后立即检查后,我发现 C 盘的可用空间减少了 7GB(之前是 15GB)。

尝试做 aVACUUM和 a,VACCUM FULL但没有任何改善。

使用 WinDirStat 和 TreeSize 进行了一些挖掘,据我所知,查询运行期间发生变化的文件就是那个pagefile.sys

虚拟内存是否以某种方式自动增加?我对此感到非常困惑。有什么想法吗?

我还尝试过的另一件事是在关闭计算机时清除上述内容,pagefile.sys但其大小没有变化。

仅供参考,这是的输出VACUUM FULL VERBOSE ANALYZE

INFO:  vacuuming "pg_catalog.pg_statistic"
INFO:  "pg_catalog.pg_statistic": found 0 removable, 441 nonremovable row versions in 28 pages
INFO:  vacuuming "pg_catalog.pg_type"
INFO:  "pg_catalog.pg_type": found 2 removable, 635 nonremovable row versions in 15 pages
INFO:  analyzing "pg_catalog.pg_type"
INFO:  "pg_type": scanned 15 of 15 pages, containing 633 live rows and 2 dead rows; 633 rows in sample, 633 estimated total rows
INFO:  vacuuming "pg_catalog.pg_foreign_table"
INFO:  "pg_catalog.pg_foreign_table": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_foreign_table"
INFO:  "pg_foreign_table": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_authid"
INFO:  "pg_catalog.pg_authid": found 0 removable, 15 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_authid"
INFO:  "pg_authid": scanned 1 of 1 pages, containing 15 live rows and 0 dead rows; 15 rows in sample, 15 estimated total rows
INFO:  vacuuming "pg_catalog.pg_statistic_ext_data"
INFO:  "pg_catalog.pg_statistic_ext_data": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_statistic_ext_data"
INFO:  "pg_statistic_ext_data": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_opclass"
INFO:  "pg_catalog.pg_opclass": found 0 removable, 177 nonremovable row versions in 3 pages
INFO:  analyzing "pg_catalog.pg_opclass"
INFO:  "pg_opclass": scanned 3 of 3 pages, containing 177 live rows and 0 dead rows; 177 rows in sample, 177 estimated total rows
INFO:  vacuuming "pg_catalog.pg_am"
INFO:  "pg_catalog.pg_am": found 0 removable, 7 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_am"
INFO:  "pg_am": scanned 1 of 1 pages, containing 7 live rows and 0 dead rows; 7 rows in sample, 7 estimated total rows
INFO:  vacuuming "pg_catalog.pg_amop"
INFO:  "pg_catalog.pg_amop": found 0 removable, 945 nonremovable row versions in 7 pages
INFO:  analyzing "pg_catalog.pg_amop"
INFO:  "pg_amop": scanned 7 of 7 pages, containing 945 live rows and 0 dead rows; 945 rows in sample, 945 estimated total rows
INFO:  vacuuming "pg_catalog.pg_amproc"
INFO:  "pg_catalog.pg_amproc": found 0 removable, 697 nonremovable row versions in 5 pages
INFO:  analyzing "pg_catalog.pg_amproc"
INFO:  "pg_amproc": scanned 5 of 5 pages, containing 697 live rows and 0 dead rows; 697 rows in sample, 697 estimated total rows
INFO:  vacuuming "pg_catalog.pg_language"
INFO:  "pg_catalog.pg_language": found 0 removable, 4 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_language"
INFO:  "pg_language": scanned 1 of 1 pages, containing 4 live rows and 0 dead rows; 4 rows in sample, 4 estimated total rows
INFO:  vacuuming "pg_catalog.pg_largeobject_metadata"
INFO:  "pg_catalog.pg_largeobject_metadata": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_largeobject_metadata"
INFO:  "pg_largeobject_metadata": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_aggregate"
INFO:  "pg_catalog.pg_aggregate": found 0 removable, 157 nonremovable row versions in 2 pages
INFO:  analyzing "pg_catalog.pg_aggregate"
INFO:  "pg_aggregate": scanned 2 of 2 pages, containing 157 live rows and 0 dead rows; 157 rows in sample, 157 estimated total rows
INFO:  vacuuming "pg_catalog.pg_statistic_ext"
INFO:  "pg_catalog.pg_statistic_ext": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_statistic_ext"
INFO:  "pg_statistic_ext": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_opfamily"
INFO:  "pg_catalog.pg_opfamily": found 0 removable, 146 nonremovable row versions in 2 pages
INFO:  analyzing "pg_catalog.pg_opfamily"
INFO:  "pg_opfamily": scanned 2 of 2 pages, containing 146 live rows and 0 dead rows; 146 rows in sample, 146 estimated total rows
INFO:  vacuuming "information_schema.sql_features"
INFO:  "information_schema.sql_features": found 0 removable, 756 nonremovable row versions in 8 pages
INFO:  analyzing "information_schema.sql_features"
INFO:  "sql_features": scanned 8 of 8 pages, containing 756 live rows and 0 dead rows; 756 rows in sample, 756 estimated total rows
INFO:  vacuuming "pg_catalog.pg_trigger"
INFO:  "pg_catalog.pg_trigger": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_trigger"
INFO:  "pg_trigger": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_event_trigger"
INFO:  "pg_catalog.pg_event_trigger": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_event_trigger"
INFO:  "pg_event_trigger": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_description"
INFO:  "pg_catalog.pg_description": found 0 removable, 5170 nonremovable row versions in 45 pages
INFO:  analyzing "pg_catalog.pg_description"
INFO:  "pg_description": scanned 45 of 45 pages, containing 5170 live rows and 0 dead rows; 5170 rows in sample, 5170 estimated total rows
INFO:  vacuuming "pg_catalog.pg_cast"
INFO:  "pg_catalog.pg_cast": found 0 removable, 229 nonremovable row versions in 2 pages
INFO:  analyzing "pg_catalog.pg_cast"
INFO:  "pg_cast": scanned 2 of 2 pages, containing 229 live rows and 0 dead rows; 229 rows in sample, 229 estimated total rows
INFO:  vacuuming "pg_catalog.pg_enum"
INFO:  "pg_catalog.pg_enum": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_enum"
INFO:  "pg_enum": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_namespace"
INFO:  "pg_catalog.pg_namespace": found 0 removable, 4 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_namespace"
INFO:  "pg_namespace": scanned 1 of 1 pages, containing 4 live rows and 0 dead rows; 4 rows in sample, 4 estimated total rows
INFO:  vacuuming "pg_catalog.pg_conversion"
INFO:  "pg_catalog.pg_conversion": found 0 removable, 128 nonremovable row versions in 2 pages
INFO:  analyzing "pg_catalog.pg_conversion"
INFO:  "pg_conversion": scanned 2 of 2 pages, containing 128 live rows and 0 dead rows; 128 rows in sample, 128 estimated total rows
INFO:  vacuuming "pg_catalog.pg_depend"
INFO:  "pg_catalog.pg_depend": found 86 removable, 1763 nonremovable row versions in 14 pages
INFO:  analyzing "pg_catalog.pg_depend"
INFO:  "pg_depend": scanned 13 of 13 pages, containing 1761 live rows and 2 dead rows; 1761 rows in sample, 1761 estimated total rows
INFO:  vacuuming "pg_catalog.pg_database"
INFO:  "pg_catalog.pg_database": found 0 removable, 21 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_database"
INFO:  "pg_database": scanned 1 of 1 pages, containing 21 live rows and 0 dead rows; 21 rows in sample, 21 estimated total rows
INFO:  vacuuming "pg_catalog.pg_tablespace"
INFO:  "pg_catalog.pg_tablespace": found 0 removable, 2 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_tablespace"
INFO:  "pg_tablespace": scanned 1 of 1 pages, containing 2 live rows and 0 dead rows; 2 rows in sample, 2 estimated total rows
INFO:  vacuuming "pg_catalog.pg_auth_members"
INFO:  "pg_catalog.pg_auth_members": found 0 removable, 3 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_auth_members"
INFO:  "pg_auth_members": scanned 1 of 1 pages, containing 3 live rows and 0 dead rows; 3 rows in sample, 3 estimated total rows
INFO:  vacuuming "pg_catalog.pg_shdepend"
INFO:  "pg_catalog.pg_shdepend": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_shdepend"
INFO:  "pg_shdepend": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_shdescription"
INFO:  "pg_catalog.pg_shdescription": found 0 removable, 3 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_shdescription"
INFO:  "pg_shdescription": scanned 1 of 1 pages, containing 3 live rows and 0 dead rows; 3 rows in sample, 3 estimated total rows
INFO:  vacuuming "pg_catalog.pg_ts_config"
INFO:  "pg_catalog.pg_ts_config": found 0 removable, 29 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_ts_config"
INFO:  "pg_ts_config": scanned 1 of 1 pages, containing 29 live rows and 0 dead rows; 29 rows in sample, 29 estimated total rows
INFO:  vacuuming "pg_catalog.pg_ts_config_map"
INFO:  "pg_catalog.pg_ts_config_map": found 0 removable, 551 nonremovable row versions in 3 pages
INFO:  analyzing "pg_catalog.pg_ts_config_map"
INFO:  "pg_ts_config_map": scanned 3 of 3 pages, containing 551 live rows and 0 dead rows; 551 rows in sample, 551 estimated total rows
INFO:  vacuuming "pg_catalog.pg_ts_dict"
INFO:  "pg_catalog.pg_ts_dict": found 0 removable, 29 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_ts_dict"
INFO:  "pg_ts_dict": scanned 1 of 1 pages, containing 29 live rows and 0 dead rows; 29 rows in sample, 29 estimated total rows
INFO:  vacuuming "pg_catalog.pg_ts_parser"
INFO:  "pg_catalog.pg_ts_parser": found 0 removable, 1 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_ts_parser"
INFO:  "pg_ts_parser": scanned 1 of 1 pages, containing 1 live rows and 0 dead rows; 1 rows in sample, 1 estimated total rows
INFO:  vacuuming "pg_catalog.pg_ts_template"
INFO:  "pg_catalog.pg_ts_template": found 0 removable, 5 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_ts_template"
INFO:  "pg_ts_template": scanned 1 of 1 pages, containing 5 live rows and 0 dead rows; 5 rows in sample, 5 estimated total rows
INFO:  vacuuming "pg_catalog.pg_extension"
INFO:  "pg_catalog.pg_extension": found 0 removable, 1 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_extension"
INFO:  "pg_extension": scanned 1 of 1 pages, containing 1 live rows and 0 dead rows; 1 rows in sample, 1 estimated total rows
INFO:  vacuuming "pg_catalog.pg_foreign_data_wrapper"
INFO:  "pg_catalog.pg_foreign_data_wrapper": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_foreign_data_wrapper"
INFO:  "pg_foreign_data_wrapper": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_foreign_server"
INFO:  "pg_catalog.pg_foreign_server": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_foreign_server"
INFO:  "pg_foreign_server": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_policy"
INFO:  "pg_catalog.pg_policy": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_policy"
INFO:  "pg_policy": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_replication_origin"
INFO:  "pg_catalog.pg_replication_origin": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_replication_origin"
INFO:  "pg_replication_origin": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_default_acl"
INFO:  "pg_catalog.pg_default_acl": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_default_acl"
INFO:  "pg_default_acl": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_init_privs"
INFO:  "pg_catalog.pg_init_privs": found 0 removable, 220 nonremovable row versions in 3 pages
INFO:  analyzing "pg_catalog.pg_init_privs"
INFO:  "pg_init_privs": scanned 3 of 3 pages, containing 220 live rows and 0 dead rows; 220 rows in sample, 220 estimated total rows
INFO:  vacuuming "pg_catalog.pg_seclabel"
INFO:  "pg_catalog.pg_seclabel": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_seclabel"
INFO:  "pg_seclabel": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_shseclabel"
INFO:  "pg_catalog.pg_shseclabel": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_shseclabel"
INFO:  "pg_shseclabel": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_collation"
INFO:  "pg_catalog.pg_collation": found 0 removable, 2245 nonremovable row versions in 41 pages
INFO:  analyzing "pg_catalog.pg_collation"
INFO:  "pg_collation": scanned 41 of 41 pages, containing 2245 live rows and 0 dead rows; 2245 rows in sample, 2245 estimated total rows
INFO:  vacuuming "pg_catalog.pg_parameter_acl"
INFO:  "pg_catalog.pg_parameter_acl": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_parameter_acl"
INFO:  "pg_parameter_acl": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_partitioned_table"
INFO:  "pg_catalog.pg_partitioned_table": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_partitioned_table"
INFO:  "pg_partitioned_table": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_range"
INFO:  "pg_catalog.pg_range": found 0 removable, 6 nonremovable row versions in 1 pages
INFO:  analyzing "pg_catalog.pg_range"
INFO:  "pg_range": scanned 1 of 1 pages, containing 6 live rows and 0 dead rows; 6 rows in sample, 6 estimated total rows
INFO:  vacuuming "pg_catalog.pg_transform"
INFO:  "pg_catalog.pg_transform": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_transform"
INFO:  "pg_transform": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_attrdef"
INFO:  "pg_catalog.pg_attrdef": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_attrdef"
INFO:  "pg_attrdef": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_constraint"
INFO:  "pg_catalog.pg_constraint": found 0 removable, 112 nonremovable row versions in 3 pages
INFO:  analyzing "pg_catalog.pg_constraint"
INFO:  "pg_constraint": scanned 3 of 3 pages, containing 112 live rows and 0 dead rows; 112 rows in sample, 112 estimated total rows
INFO:  vacuuming "pg_catalog.pg_inherits"
INFO:  "pg_catalog.pg_inherits": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_inherits"
INFO:  "pg_inherits": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_index"
INFO:  "pg_catalog.pg_index": found 1 removable, 173 nonremovable row versions in 4 pages
INFO:  analyzing "pg_catalog.pg_index"
INFO:  "pg_index": scanned 4 of 4 pages, containing 173 live rows and 0 dead rows; 173 rows in sample, 173 estimated total rows
INFO:  vacuuming "pg_catalog.pg_operator"
INFO:  "pg_catalog.pg_operator": found 0 removable, 799 nonremovable row versions in 14 pages
INFO:  analyzing "pg_catalog.pg_operator"
INFO:  "pg_operator": scanned 14 of 14 pages, containing 799 live rows and 0 dead rows; 799 rows in sample, 799 estimated total rows
INFO:  vacuuming "pg_catalog.pg_sequence"
INFO:  "pg_catalog.pg_sequence": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_sequence"
INFO:  "pg_sequence": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_user_mapping"
INFO:  "pg_catalog.pg_user_mapping": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_user_mapping"
INFO:  "pg_user_mapping": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_subscription"
INFO:  "pg_catalog.pg_subscription": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_subscription"
INFO:  "pg_subscription": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_attribute"
INFO:  "pg_catalog.pg_attribute": found 230 removable, 3345 nonremovable row versions in 77 pages
INFO:  analyzing "pg_catalog.pg_attribute"
INFO:  "pg_attribute": scanned 61 of 61 pages, containing 3313 live rows and 32 dead rows; 3313 rows in sample, 3313 estimated total rows
INFO:  vacuuming "pg_catalog.pg_proc"
INFO:  "pg_catalog.pg_proc": found 0 removable, 3297 nonremovable row versions in 96 pages
INFO:  analyzing "pg_catalog.pg_proc"
INFO:  "pg_proc": scanned 96 of 96 pages, containing 3297 live rows and 0 dead rows; 3297 rows in sample, 3297 estimated total rows
INFO:  vacuuming "pg_catalog.pg_publication_namespace"
INFO:  "pg_catalog.pg_publication_namespace": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_publication_namespace"
INFO:  "pg_publication_namespace": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_publication_rel"
INFO:  "pg_catalog.pg_publication_rel": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_publication_rel"
INFO:  "pg_publication_rel": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_subscription_rel"
INFO:  "pg_catalog.pg_subscription_rel": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_subscription_rel"
INFO:  "pg_subscription_rel": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "information_schema.sql_implementation_info"
INFO:  "information_schema.sql_implementation_info": found 0 removable, 12 nonremovable row versions in 1 pages
INFO:  analyzing "information_schema.sql_implementation_info"
INFO:  "sql_implementation_info": scanned 1 of 1 pages, containing 12 live rows and 0 dead rows; 12 rows in sample, 12 estimated total rows
INFO:  vacuuming "information_schema.sql_parts"
INFO:  "information_schema.sql_parts": found 0 removable, 11 nonremovable row versions in 1 pages
INFO:  analyzing "information_schema.sql_parts"
INFO:  "sql_parts": scanned 1 of 1 pages, containing 11 live rows and 0 dead rows; 11 rows in sample, 11 estimated total rows
INFO:  vacuuming "information_schema.sql_sizing"
INFO:  "information_schema.sql_sizing": found 0 removable, 23 nonremovable row versions in 1 pages
INFO:  analyzing "information_schema.sql_sizing"
INFO:  "sql_sizing": scanned 1 of 1 pages, containing 23 live rows and 0 dead rows; 23 rows in sample, 23 estimated total rows
INFO:  vacuuming "pg_catalog.pg_largeobject"
INFO:  "pg_catalog.pg_largeobject": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_largeobject"
INFO:  "pg_largeobject": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "public.customers"
INFO:  "public.customers": found 0 removable, 91 nonremovable row versions in 2 pages
INFO:  analyzing "public.customers"
INFO:  "customers": scanned 2 of 2 pages, containing 91 live rows and 0 dead rows; 91 rows in sample, 91 estimated total rows
INFO:  vacuuming "public.categories"
INFO:  "public.categories": found 0 removable, 8 nonremovable row versions in 1 pages
INFO:  analyzing "public.categories"
INFO:  "categories": scanned 1 of 1 pages, containing 8 live rows and 0 dead rows; 8 rows in sample, 8 estimated total rows
INFO:  vacuuming "public.employees"
INFO:  "public.employees": found 0 removable, 9 nonremovable row versions in 1 pages
INFO:  analyzing "public.employees"
INFO:  "employees": scanned 1 of 1 pages, containing 9 live rows and 0 dead rows; 9 rows in sample, 9 estimated total rows
INFO:  vacuuming "public.order_details"
INFO:  "public.order_details": found 0 removable, 2155 nonremovable row versions in 15 pages
INFO:  analyzing "public.order_details"
INFO:  "order_details": scanned 15 of 15 pages, containing 2155 live rows and 0 dead rows; 2155 rows in sample, 2155 estimated total rows
INFO:  vacuuming "public.orders"
INFO:  "public.orders": found 0 removable, 830 nonremovable row versions in 7 pages
INFO:  analyzing "public.orders"
INFO:  "orders": scanned 7 of 7 pages, containing 830 live rows and 0 dead rows; 830 rows in sample, 830 estimated total rows
INFO:  vacuuming "public.products"
INFO:  "public.products": found 0 removable, 77 nonremovable row versions in 1 pages
INFO:  analyzing "public.products"
INFO:  "products": scanned 1 of 1 pages, containing 77 live rows and 0 dead rows; 77 rows in sample, 77 estimated total rows
INFO:  vacuuming "public.shippers"
INFO:  "public.shippers": found 0 removable, 3 nonremovable row versions in 1 pages
INFO:  analyzing "public.shippers"
INFO:  "shippers": scanned 1 of 1 pages, containing 3 live rows and 0 dead rows; 3 rows in sample, 3 estimated total rows
INFO:  vacuuming "public.monthly_date_dimension"
INFO:  "public.monthly_date_dimension": found 0 removable, 23 nonremovable row versions in 1 pages
INFO:  analyzing "public.monthly_date_dimension"
INFO:  "monthly_date_dimension": scanned 1 of 1 pages, containing 23 live rows and 0 dead rows; 23 rows in sample, 23 estimated total rows
INFO:  vacuuming "public.countries_only"
INFO:  "public.countries_only": found 0 removable, 69 nonremovable row versions in 1 pages
INFO:  analyzing "public.countries_only"
INFO:  "countries_only": scanned 1 of 1 pages, containing 69 live rows and 0 dead rows; 69 rows in sample, 69 estimated total rows
INFO:  vacuuming "pg_catalog.pg_rewrite"
INFO:  "pg_catalog.pg_rewrite": found 0 removable, 143 nonremovable row versions in 13 pages
INFO:  analyzing "pg_catalog.pg_rewrite"
INFO:  "pg_rewrite": scanned 13 of 13 pages, containing 143 live rows and 0 dead rows; 143 rows in sample, 143 estimated total rows
INFO:  vacuuming "pg_catalog.pg_db_role_setting"
INFO:  "pg_catalog.pg_db_role_setting": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_db_role_setting"
INFO:  "pg_db_role_setting": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_class"
INFO:  "pg_catalog.pg_class": found 23 removable, 442 nonremovable row versions in 13 pages
INFO:  analyzing "pg_catalog.pg_class"
INFO:  "pg_class": scanned 12 of 12 pages, containing 441 live rows and 2 dead rows; 441 rows in sample, 441 estimated total rows
INFO:  vacuuming "pg_catalog.pg_publication"
INFO:  "pg_catalog.pg_publication": found 0 removable, 0 nonremovable row versions in 0 pages
INFO:  analyzing "pg_catalog.pg_publication"
INFO:  "pg_publication": scanned 0 of 0 pages, containing 0 live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "public.date_and_country"
INFO:  "public.date_and_country": found 0 removable, 1587 nonremovable row versions in 14 pages
INFO:  analyzing "public.date_and_country"
INFO:  "date_and_country": scanned 14 of 14 pages, containing 1587 live rows and 0 dead rows; 1587 rows in sample, 1587 estimated total rows
VACUUM

Query returned successfully in 22 secs 115 msec.

答案1

这是正常的页面文件系统更改,如果你让它自动设置。它的使用表明 PC 没有不是没有足够的 RAM 在内存中运行 SQL 查询,因此它开始将部分交换到磁盘——这是一个非常缓慢的操作,即使使用 SSD 也是如此。下次重新启动 PC 时,页面文件系统应收缩至其初始设置。

然而,你可以决定设置大小自己优化该文件以优化大型查询并减少文件大小的不断调整,这可能会导致碎片化。

的大小页面文件系统由系统属性控制面板设置。

  • WindowsR,输入sysdm.cpl,按CtrlShiftEnter,然后允许系统属性CPL 以管理员身份运行。
  • 先进的选项卡,选择性能 | 设置
  • 先进的选项卡性能选项对话框中,选择虚拟内存 | 更改
  • 使用虚拟内存对话框来设置大小页面文件系统

你可以找到各种关于设置该大小的建议。我倾向于设置一个自定义大小将初始大小和最大大小设置为相同的值,以防止硬盘不断增长和缩小。建议的值范围为一半物理 RAM(例如,在下图中,来自 4 GB RAM 的机器,它设置为 2 GB),两次内存。尝试不同的内存量,看看运行 SQL 查询的最佳内存量是多少你的PC——更改页面文件大小后重新启动。

设置虚拟内存

相关内容