Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance 解释(缓冲、分析)理解_Performance_Postgresql_Database Design_Postgresql 9.3_Postgresql Performance - Fatal编程技术网

Performance 解释(缓冲、分析)理解

Performance 解释(缓冲、分析)理解,performance,postgresql,database-design,postgresql-9.3,postgresql-performance,Performance,Postgresql,Database Design,Postgresql 9.3,Postgresql Performance,我正在使用PostgreSQL 9.3,有人能帮我做些什么来改进吗。db表中的最大记录数约为5000到7000条,每天变化。PGsql DB中的共享缓冲区设置为=1GB。这里怎么了。我的查询o/p是 EXPLAIN (BUFFERS,ANALYZE) select sd.customer_id, ch.charge_trx_id, ch.updated_date, ch.command_tx_id, ch.mvno_id, ch.customer_id, ch.extra_pla

我正在使用PostgreSQL 9.3,有人能帮我做些什么来改进吗。db表中的最大记录数约为5000到7000条,每天变化。PGsql DB中的共享缓冲区设置为=1GB。这里怎么了。我的查询o/p是

EXPLAIN (BUFFERS,ANALYZE) 
select sd.customer_id, ch.charge_trx_id, ch.updated_date, ch.command_tx_id, ch.mvno_id,
       ch.customer_id, ch.extra_plan_id, ch.base_plan_id, ch.old_base_plan_id, ch.volume,
       ch.price, ch.charge_type, ch.remarks 
from charge_history ch,
     subscriber_data sd
where sd.customer_id = ch.customer_id
  and ch.updated_date::date = (CURRENT_DATE - integer '1')
  and ch.picked_status = 'NOTPICKED';
:


请放入您的计划并使用resultQuery填充链接:解释(缓冲区,分析)选择subsc\U数据。客户id,费用历史记录。费用trx\U id,费用历史记录。更新日期,费用历史记录。命令发送id,费用历史记录id,费用历史记录。客户id,费用历史记录。额外计划id,费用历史记录。基础计划id,费用历史记录。旧基础计划id,charge_history.volume,charge_history.price,charge_history.charge_type,charge_history.charge_备注来自charge_history,订户_数据其中订户_数据。customer_id=charge_history.customer_id和charge_history。更新的_日期::日期=(当前_日期-整数'1')和'charge_history.picked_状态='NOTPICKED';如何改进此查询运行您的查询。复制结果。将其粘贴到depesz表单并单击提交。然后复制链接并将其放到你的问题中,请在52毫秒内找到近4000条记录。不错。它应该有多快,你想要什么速度?
                                                                  QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------
Nested Loop  (cost=0.85..10873.44 rows=75 width=271) (actual time=0.123..51.515 rows=3982 loops=1)
   Buffers: shared hit=18475 read=55682
   ->  Index Scan using idx_chrghist_picked_status on charge_history  (cost=0.42..10239.13 rows=75 width=255) (actual time=0.092..16.022 rows=3982 loops=1)
         Index Cond: (picked_status = 'NOTPICKED'::text)
         Filter: ((updated_date)::date = (('now'::cstring)::date - 1))
         Rows Removed by Filter: 10022
         Buffers: shared hit=2547 read=55682
   ->  Index Scan using "CUSTOMERID" on subscriber_data  (cost=0.43..8.45 rows=1 width=36) (actual time=0.008..0.008 rows=1 loops=3982)
         Index Cond: ((customer_id)::text = (charge_history.customer_id)::text)
         Buffers: shared hit=15928
Total runtime: 52.053 ms
(11 rows)