sysadmin:postgresql
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
sysadmin:postgresql [2014/11/25 17:17] – occupazione db feroda | sysadmin:postgresql [2015/02/12 08:57] – CREAZIONE E USO INDICI feroda | ||
---|---|---|---|
Line 71: | Line 71: | ||
* [4] = ... indici usati ma non efficaci | * [4] = ... indici usati ma non efficaci | ||
* [5] = ... tabelle vuote | * [5] = ... tabelle vuote | ||
+ | |||
+ | ====== CREAZIONE E USO INDICI ======= | ||
+ | |||
+ | postgres# \d+ acs_service.connection_session; | ||
+ | | ||
+ | ------------+--------------------------+-----------------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Indexes: | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | Foreign-key constraints: | ||
+ | " | ||
+ | Has OIDs: no | ||
+ | |||
+ | postgres# REINDEX TABLE " | ||
+ | REINDEX | ||
+ | postgres# EXPLAIN ANALYZE SELECT bcs.id, bcs.duration FROM acs_service.connection_session bcs WHERE bcs.duration IS NULL; | ||
+ | QUERY PLAN | ||
+ | ------------------------------------------------------------------------------------------------------------------------------------------ | ||
+ | Bitmap Heap Scan on connection_session bcs (cost=4.82..234.49 rows=70 width=20) (actual time=0.117..0.180 rows=67 loops=1) | ||
+ | | ||
+ | | ||
+ | Index Cond: (duration IS NULL) | ||
+ | Total runtime: 0.208 ms (5 rows) | ||
+ | |||
+ | postgres=# EXPLAIN ANALYZE SELECT bcs.id, bcs.duration FROM acs_service.connection_session bcs WHERE bcs.duration IS NOT NULL; | ||
+ | QUERY PLAN | ||
+ | ------------------------------------------------------------------------------------------------------------------------------- | ||
+ | Seq Scan on connection_session bcs (cost=0.00..2829.78 rows=149208 width=20) (actual time=0.008..36.858 rows=149211 loops=1) | ||
+ | | ||
+ | Total runtime: 46.523 ms (3 rows) | ||
====== Occupazione disco ====== | ====== Occupazione disco ====== |