pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: david@stanaway.net
To: pgsql-sql@postgresql.org
Subject: Timestamp index not used
Date: Wed, 7 May 2003 22:56:15 -0500 (CDT)
Message-ID: <50240.10.0.50.1.1052366175.squirrel@david.stanaway.net> (raw)

What kind of index should I be using on the timestamp column for it to

be used for BETWEEN and > operations?



radius=# EXPLAIN SELECT * from alldata where loggedat > '2003-05-07';

NOTICE:  QUERY PLAN:



Seq Scan on alldata  (cost=0.00..286136.26 rows=1428487 width=780)



EXPLAIN

radius=# \d alldata

                                            Table "alldata"

        Column         |           Type           |

Modifiers

-----------------------+--------------------------+----------------------------------------------------
 query                 | text                     |

 cisco_nas_port        | text                     |

 h323_remote_address   | text                     |

 h323_conf_id          | text                     |

 h323_setup_time       | text                     |

 h323_call_origin      | text                     |

 h323_call_type        | text                     |

 h323_connect_time     | text                     |

 h323_disconnect_time  | text                     |

 h323_disconnect_cause | text                     |

 h323_voice_quality    | text                     |

 h323_gw_id            | text                     |

 nas_ip_address        | text                     |

 nas_port_type         | text                     |

 called_station_id     | text                     |

 calling_station_id    | text                     |

 acct_status_type      | text                     |

 acct_session_id       | text                     |

 acct_input_octets     | text                     |

 acct_output_octets    | text                     |

 acct_input_packets    | text                     |

 acct_output_packets   | text                     |

 acct_session_time     | text                     |

 acct_delay_time       | text                     |

 identity              | integer                  | default

nextval('alldata_identity_seq'::text)

 loggedat              | timestamp with time zone | default

('now'::text)::timestamp(6) with time zone

Indexes: alldata_call_origin_idx,

         alldata_call_type_idx,

         alldata_conf_id_idx,

         alldata_nas_ip_address_idx,

         alldate_loggedat_idx,

         remote_address_idx

Unique keys: alldata_identity_pkey



radius=# \d alldate_loggedat_idx

    Index "alldate_loggedat_idx"

  Column  |           Type

----------+--------------------------

 loggedat | timestamp with time zone

btree




view thread (2+ messages)  latest in thread

Message-ID: <50240.10.0.50.1.1052366175.squirrel@david.stanaway.net>
Permalink:  ../50240.10.0.50.1.1052366175.squirrel@david.stanaway.net/
Also on:    postgresql.org/message-id/50240.10.0.50.1.1052366175.squirrel@david.stanaway.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: david@stanaway.net
  Subject: Re: Timestamp index not used
  In-Reply-To: <50240.10.0.50.1.1052366175.squirrel@david.stanaway.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox