psql (9.6.0) Type "help" for help. perftestdb=# select count(*) from subscriber; count -------- 100000 (1 row) perftestdb=# \d subscriber Table "public.subscriber" Column | Type | Modifiers --------------+-----------------------+----------- s_id | integer | not null sub_nbr | character varying(15) | not null bit_1 | smallint | bit_2 | smallint | bit_3 | smallint | bit_4 | smallint | bit_5 | smallint | bit_6 | smallint | bit_7 | smallint | bit_8 | smallint | bit_9 | smallint | bit_10 | smallint | hex_1 | smallint | hex_2 | smallint | hex_3 | smallint | hex_4 | smallint | hex_5 | smallint | hex_6 | smallint | hex_7 | smallint | hex_8 | smallint | hex_9 | smallint | hex_10 | smallint | byte2_1 | smallint | byte2_2 | smallint | byte2_3 | smallint | byte2_4 | smallint | byte2_5 | smallint | byte2_6 | smallint | byte2_7 | smallint | byte2_8 | smallint | byte2_9 | smallint | byte2_10 | smallint | msc_location | integer | vlr_location | integer | Indexes: "subscriber_pkey" PRIMARY KEY, btree (s_id) "subscriber_by_sub_nbr" UNIQUE, btree (sub_nbr) Referenced by: TABLE "access_info" CONSTRAINT "access_info_s_id_fkey" FOREIGN KEY (s_id) REFERENCES subscriber(s_id) TABLE "special_facility" CONSTRAINT "special_facility_s_id_fkey" FOREIGN KEY (s_id) REFERENCES subscriber(s_id) perftestdb=# explain analyze select * from subscriber where s_id = 100; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- Index Scan using subscriber_pkey on subscriber (cost=0.29..8.31 rows=1 width=88) (actual time=0.046..0.049 rows=1 loops=1) Index Cond: (s_id = 100) Planning time: 0.396 ms Execution time: 0.181 ms (4 rows) perftestdb=# explain analyze select * from subscriber where s_id = 100; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- Index Scan using subscriber_pkey on subscriber (cost=0.29..8.31 rows=1 width=88) (actual time=0.036..0.038 rows=1 loops=1) Index Cond: (s_id = 100) Planning time: 0.354 ms Execution time: 0.160 ms (4 rows) perftestdb=# explain analyze select * from subscriber where s_id = 100; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- Index Scan using subscriber_pkey on subscriber (cost=0.29..8.31 rows=1 width=88) (actual time=0.045..0.047 rows=1 loops=1) Index Cond: (s_id = 100) Planning time: 0.395 ms Execution time: 0.180 ms (4 rows) perftestdb=# explain analyze select * from subscriber where s_id = 100; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- Index Scan using subscriber_pkey on subscriber (cost=0.29..8.31 rows=1 width=88) (actual time=0.045..0.048 rows=1 loops=1) Index Cond: (s_id = 100) Planning time: 0.392 ms Execution time: 0.180 ms (4 rows) Configuration: max_connections = 100 shared_buffers = 128MB effective_cache_size = 256MB checkpoint_timeout = 180s wal_keep_segments = 10 archive_command = 'rm ./Archive_*; touch ./Archive_"%f"; exit 0' archive_timeout = 0 max_wal_size = 40MB min_wal_size = 40MB #-- Some helpful logging to detect deadlock and IO load log_lock_waits = on log_checkpoints = on archive_mode = on tcp_keepalives_idle = 15 tcp_keepalives_interval = 5 tcp_keepalives_count = 3 max_wal_senders = 5 wal_level = hot_standby hot_standby = on wal_retrieve_retry_interval = 2s # REST ALL PARAMETERS ARE DEFAULT