Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
0 votes
2 answers
151 views

I have a table that contains ~ 100.000.000 records. In this table, there's a varchar(30) column that contains the license plates of cars. I'm joining this table with another table that contains the ...
Mario Agati's user avatar
0 votes
1 answer
1k views

Context: Postgres 15 table hundreds of millions or maybe billions of rows, the tables contain an id colummn and a JSONB column no other constraints (FKs) selecting from the table is usually/often ...
Mate Varga's user avatar
  • 3,436
0 votes
2 answers
319 views

With this table: CREATE TABLE bins ( id SERIAL PRIMARY KEY, start TIMESTAMP NOT NULL, bits BIT(16) NOT NULL, topleft POINT, -- (x,y) in web mercator projection count INTEGER ); ...
fadedbee's user avatar
  • 45.2k
1 vote
1 answer
195 views

When trying to create index on remote Azure server (PostgreSQL 11.19 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit) create index test on "Table" using ...
Anton Chaika's user avatar
2 votes
1 answer
4k views

I have a postgres function called 'medrealize()' inside which i am creating temp table and creating index for temp tables using below lines CREATE INDEX SQLOPS_RefICD_ICD10_idx ON t$...
User123's user avatar
  • 853
0 votes
1 answer
540 views

I am trying to write a new column based on the intersection of two polygon features which have 50m rows in one table, I have created the "gist" index before running them but it takes forever ...
Aravinth's user avatar
0 votes
0 answers
106 views

There are two DB machines identical in structure and configurations with the characteristics as below. The databases are also identical in structure and contents. The performance of almost 99% of ...
Liviu Nastase's user avatar
1 vote
1 answer
356 views

I am building an app where the server needs to select rows based on some criteria/filters. One of them is the location of the user and the radius at which the user want's to see posts and other ...
Najib's user avatar
  • 229
3 votes
1 answer
926 views

I am currently working with a bitemporal application, which stores data entries using 4 timestamps: Valid_from, Valid_to Registration_from, Registration_to The first two state when the given entry is ...
kafka's user avatar
  • 733
1 vote
0 answers
46 views

I'm trying to implement exclude constraint and I have written the function which returns more than one separate parameters (types: character varying). What I want is to call this function twice, but ...
alterego's user avatar
  • 352
1 vote
1 answer
1k views

I have a database in PostgreSQL with the following structure: Column | Type | Collation | Nullable | Default -------------+-----------------...
e7lT2P's user avatar
  • 1,971
2 votes
1 answer
186 views

In a regular b-tree index, the leaf node contains a key and a pointer to the heap tuple (user table row), which signifies that in b-tree, the relationship between index tuple and user table row is one-...
JessePinkman's user avatar
4 votes
0 answers
360 views

With a 128 dimension column and a distance query as below: CREATE TABLE testes (id serial, name text, face cube); CREATE INDEX testes_face_idx ON testes USING gist(face gist_cube_ops); explain ...
Kobus's user avatar
  • 111
1 vote
1 answer
517 views

I have a composite type. And I want to define exclusion constraint on it, that would also be combined with range exclusions, but getting the following error. create type example_t as ( x uuid, ...
boxx's user avatar
  • 1,121
0 votes
0 answers
377 views

I have a Postgres 9.5 database with Postgis installed. I created a materialized view that is made from about 200 tables. The entire view contains 3,447,885 records. Each record has a location field ...
user2333312's user avatar
1 vote
0 answers
40 views

Situation: Table Waypoints is relatively large (150M rows) and contains (amongst others) the columns user_id and a timestamp tracked_at. Table Storyline is a smaller Table (300K rows) that contains ...
user1965813's user avatar
0 votes
1 answer
2k views

There is a table like following: CREATE TABLE test (my_field jsonb NOT NULL) The my_field has a key like collection which stores values in varchar[] format: {my_field: {collection: ['a', 'b', 'c']}} ...
Kaveh's user avatar
  • 421
3 votes
1 answer
4k views

Using PostgreSQL version 9.4.5, I have a table that contains an INET column. In that column I have a gist index CREATE TABLE ipv4_prefix ( id uuid DEFAULT public.uuid_generate_v4() NOT NULL, ...
Josha Inglis's user avatar
  • 1,058
1 vote
1 answer
1k views

I have a tricky problem trying to find an efficient way of ordering a set of objects (~1000 rows) that contain a large (~5 million) number of indexed data points. In my case I need a query that allows ...
Chris Noldus's user avatar
  • 2,502
2 votes
1 answer
956 views

I'm using range datatypes in PG 9.3 (with btree_gist enabled, though I don't think it matters). I have GIST indexes that include these range columns. Some are int8range and some are tsrange. I want ...
jennykwan's user avatar
  • 2,701
7 votes
1 answer
10k views

I have a simple table which has a user_birthday field with a type of date (which can be NULL value) CREATE TABLE users ( user_id bigserial NOT NULL, user_email text NOT NULL, user_password text,...
Shahar Hadas's user avatar
  • 2,867
16 votes
3 answers
9k views

I can't use directly uuid with gist index CREATE INDEX idx_leaderboads_values_gist ON leaderboard_entry USING gist (id_leaderboard , value); And I got this error: ERROR: data type uuid has ...
xjodoin's user avatar
  • 549
4 votes
1 answer
2k views

Let's suppose a table: CREATE TABLE foo ( id serial primary key , range int4range NOT NULL , barid integer references bar(id) , baz whatever... NOT NULL , EXCLUDE USING gist (range WITH &...
murison's user avatar
  • 4,055
11 votes
1 answer
3k views

I have to decide whether to use GIN or GiST indexing for an hstore column. The Postgres docs state: GIN index lookups are about three times faster than GiST GIN indexes take about three times longer ...
migu's user avatar
  • 4,356
4 votes
2 answers
3k views

how can I detect GIN and GiST indexes in postgresql? I am looking for if an database of postgres use fulltext. I think that a table use GIN o GiST then is using fulltext. I accept that GIN or GiST ...
user2044138's user avatar
10 votes
4 answers
18k views

I'm using PostgreSQL 9.2 and have a table of IP ranges. Here's the SQL: CREATE TABLE ips ( id serial NOT NULL, begin_ip_num bigint, end_ip_num bigint, country_name character varying(255), ...
Zain Zafar's user avatar
17 votes
4 answers
14k views

I have been working on optimizing my Postgres databases recently, and traditionally, I've only ever use B-Tree indexes. However, I saw that GiST indexes suport non-unique, multicolumn indexes, in the ...
Ash's user avatar
  • 25.9k
40 votes
1 answer
21k views

From what information I could find, they both solve the same problems - more esoteric operations like array containment and intersection (&&, @>, <@, etc). However I would be interested in ...
Grey Panther's user avatar
  • 13.2k