Linked Questions

4 votes
1 answer
13k views

In a multi-tenant only one DB, one column is used to isolate customers data, that is customer_id. Is it possible to get the storage size of a certain customer in all tables?
simo's user avatar
  • 301
8 votes
0 answers
155 views

This answer motivated think again my following tables but I am still uncertain how to store variables/results from data analysis for quick selection in post-processing. If stored, I think it is well ...
Léo Léopold Hertz 준영's user avatar
0 votes
0 answers
83 views

Is there a way to calculate the row size (in bytes) of a particular table in postgresql / pgadmin3?
Nick Ginanto's user avatar
  • 1,009
98 votes
4 answers
105k views

According to PostgreSQL's docs, there's no performance difference between VARCHAR, VARCHAR(n) and TEXT. Should I add an arbitrary length limit to a name or address column? Edit: Not a dupe of: Would ...
Daniel Serodio's user avatar
132 votes
3 answers
69k views

Let's say I have a table with fields A and B. I make regular queries on A+B, so I created a composite index on (A,B). Would queries on only A also be fully optimized by the composite index? ...
Luciano's user avatar
  • 1,771
55 votes
2 answers
65k views

We have a 2.2 GB table in Postgres with 7,801,611 rows in it. We are adding a uuid/guid column to it and I am wondering what the best way to populate that column is (as we want to add a NOT NULL ...
Collin Peters's user avatar
49 votes
2 answers
58k views

Our system writes a lots of data (kind of Big Data system). Write performance is good enough for our needs but read performance is really too slow. The primary key (constraint) structure is similar ...
JPelletier's user avatar
29 votes
5 answers
91k views

Supposing we have a table with four columns (a,b,c,d) of the same data type. Is it possible to select all distinct values within the data in the columns and return them as a single column or do I ...
Fabrizio Mazzoni's user avatar
54 votes
1 answer
62k views

I am developing an application in Ruby on Rails with the PostgreSQL (9.4) database. For my use case, columns in tables will be looked up very frequently, as the whole point of the application is ...
Chris Cirefice's user avatar
47 votes
1 answer
18k views

I have a legacy schema (disclaimer!) that uses a hash-based generated id for the primary key for all tables (there are many). An example of such an id is: 922475bb-ad93-43ee-9487-d2671b886479 There ...
Bohemian's user avatar
  • 733
37 votes
1 answer
59k views

VACUUM usually does not return disk space to operating system, except in some special cases. From the docs: The standard form of VACUUM removes dead row versions in tables and indexes and marks the ...
Vadim Samokhin's user avatar
24 votes
2 answers
81k views

I've imported data into a new database (about 600m rows of timestamp, integer, double). I then created some indexes and tried to alter some columns (got some out of space issues), the database is ...
Ofiris's user avatar
  • 811
25 votes
1 answer
23k views

I wanted to ask for the meaning of this fragment from Postgres doc regarding varchar(n) type: The storage requirement for a short string (up to 126 bytes) is 1 byte plus the actual string, which ...
keypress's user avatar
  • 353
20 votes
1 answer
16k views

I know how to check the size of indexes and tables in Postgres (I'm using version 9.4): SELECT relname AS objectname, relkind AS objecttype, reltuples AS "#entries", pg_size_pretty(relpages::...
Richard's user avatar
  • 343
6 votes
3 answers
3k views

In my API, the user can potentially send a request which tries to create a new row when a row with that unique key exists. Currently, I'm catching the unique key error and returning a message to say ...
James Hay's user avatar
  • 285

15 30 50 per page