Reputation
34,343
Next tag badge:
96/100 score
27/20 answers
Badges
3 53 96
Newest
 Necromancer
Impact
~1.4m people reached

12h
comment Trigger function using current row and current table name as variables (final part)
If the answers answers your question, consider accepting it.
12h
comment Trigger function using current row and current table name as variables (final part)
@Natysiu16: 1. trunc() should just work and is a bit faster. It's really not important, it was just an aside. See fiddle: sqlfiddle.com/#!15/9eecb7db59d16c80417c72d1e1f4fbf1/2893. 2. Yes, different columns, but same row. I select both columns at once which costs almost nothing, while executing another query is expensive.
12h
comment Trigger function using current row and current table name as variables (final part)
@Natysiu16: Performance depends on many factors. Details: dba.stackexchange.com/a/8189/3684. You should be able to replace floor() with trunc(). What's the data type of timeidx?
15h
comment Can I do VACUUM FULL to pg_largeobject table?
@Spike: If that answers your question, consider accepting it.
15h
revised Can I do VACUUM FULL to pg_largeobject table?
typo
1d
comment PostgreSQL 9.3 is not returning existing rows with Ruby on Rails or Squirrel
About double-quoted identifiers: dba.stackexchange.com/a/34109/3684, and why it's better not to use them in Postgres: stackoverflow.com/a/20880247/939860
1d
revised Can I do VACUUM FULL to pg_largeobject table?
added 128 characters in body
1d
revised Can I do VACUUM FULL to pg_largeobject table?
format title
1d
answered Can I do VACUUM FULL to pg_largeobject table?
1d
revised Can I do VACUUM FULL to pg_largeobject table?
format, typos, add tag
1d
revised How to determine whether a PostgreSQL Hot Standby is fully mirrored?
trim noise, format, better title, tag
1d
revised Managing and speeding up queries on PostgreSQL table with over 3 trillion rows
add more, links and adapt syntax to updated question
1d
revised Managing and speeding up queries on PostgreSQL table with over 3 trillion rows
make example query and table definition syntactically valid and consistent
1d
revised Managing and speeding up queries on PostgreSQL table with over 3 trillion rows
trim noise, format, typos
1d
comment Managing and speeding up queries on PostgreSQL table with over 3 trillion rows
@Greg: Great that it helps! (Not sure why you mentioned "three columns", I suggested an index on one or two columns. Don't create more than one index for this.)
2d
comment PostgreSQL failed on Select
@AChang: Are you going to update your question to provide missing information?
2d
comment Improve performance for order by with columns from many tables
@BremerRodrigues: Like I wrote: no good for a large LIMIT. The number in OFFSET has to be added to that. Postgres has no other way to determine the row at position 900001 than compute the 900000 rows before that. This can only be avoided with a true index scan, where it's trivial to skip n rows. Not an option here. The only remaining option I see to make this fast is a materialized view with an added row number.
Aug
28
revised Increasing work_mem and shared_buffers on Postgres 9.2 significantly slows down queries
add multicolumn index
Aug
28
comment PostgreSQL failed on Select
inot instead of into is just a typo in the question or part of the problem? Also, data_list is not declared in your example. Please provide a complete function, table definitions and always your version of Postgres.
Aug
28
comment Matching data in two tables
Very nice to see MySQL and Postgres side-by-side to compare. For the Postgres part, I would have too much to comment on. Here is how I would calculate total orders for all customers: SELECT Cust_ID, c.Name, c.CC_Number, o.total FROM Customer c LEFT JOIN ( SELECT Cust_ID, SUM(o.Order_Value) AS total FROM Cust_Order GROUP BY Cust_ID ) o USING (Cust_ID) ORDER BY Cust_ID;