Postgres is ignoring a timestamp index, why?
问题 I have the following tables: users (id, network_id) networks (id) private_messages (id, sender_id, receiver_id, created_at) I have indexes on users.network_id, and all 3 columns in private messages however the query is skipping the indexes and taking a very long time to run. Any ideas what is wrong in the query that is causing the index to be skipped? EXPLAIN ANALYZE SELECT COUNT(*) FROM "networks" WHERE ( networks.created_at BETWEEN ((timestamp '2013-01-01')) AND (( (timestamp '2013-01-31')