Linked Questions

197 votes
9 answers
262k views

How do I force Postgres to use an index when it would otherwise insist on doing a sequential scan?
119 votes
1 answer
129k views

I have a table that looks like this: CREATE TABLE tracks (id SERIAL, artists JSON); INSERT INTO tracks (id, artists) VALUES (1, '[{"name": "blink-182"}]'); INSERT INTO tracks (id, artists) ...
JeffS's user avatar
  • 2,767
37 votes
6 answers
45k views

I have a strange problem with PostgreSQL performance for a query, using PostgreSQL 8.4.9. This query is selecting a set of points within a 3D volume, using a LEFT OUTER JOIN to add a related ID ...
Mark Longair's user avatar
6 votes
2 answers
3k views

Here's an example plan on explain.depesz.com: Limit (cost=65301.950..65301.950 rows=1 width=219) (actual time=886.074..886.074 rows=0 loops=1) -> Sort (cost=65258.840..65301.950 rows=17243 ...
TheFooProgrammer's user avatar
6 votes
2 answers
5k views

I have created index like CREATE INDEX bill_open_date_idx ON bill USING btree(date(open_date)); and, Column | Type open_date | timestamp without time zone And explain analyse are ...
Mohamed Anees A's user avatar
3 votes
1 answer
6k views

I have a Postgres table with a column that's an array of strings. The only searches that will be done using this column will be either IS NULL / IS NOT NULL and queries asking for rows where the array ...
Peter Gerdes's user avatar
  • 3,113
3 votes
2 answers
5k views

In my PostgreSQL 11.11 I have one jsonb column that holds objects like this: { "dynamicFields":[ { "name":"200", "hidden":false, ...
André Luiz's user avatar
  • 7,422
2 votes
1 answer
5k views

I have around 1 billion rows and 6 columns (id, col1, col2..col5) in my Postgres database table. I have id as my PRIMARY_KEY. I am using this as a read-only database, and every time I only need to ...
Sushant's user avatar
  • 109
1 vote
1 answer
870 views

I create a test table in my postgresql db to try to describe the question. table name: test columns: id (varchar, uuid), created_at (timestamp) I insert some mock data into the table. postgres=# ...
yukuan's user avatar
  • 561
0 votes
1 answer
435 views

I am doing a query to select records that lie in a certain geographic region and I am doing some joins and couple of filtering as well. This is my query: SELECT "events".* FROM "events" INNER JOIN "...
Steve Robinson's user avatar