11,143 reputation
11842
bio website
location Munich
age
visits member for 3 years, 2 months
seen 5 mins ago

5m
revised Index on 'GROUP BY' with functions
edited tags
2h
comment Why is my composite index not used for this table?
Half a millisecond doesn't seem to be slow though...
1d
revised How to avoid the SORT operation in SQL query that contains ORDER_BY condition?
spelling
Jul
22
revised Adding a constant IF not in an other table
added 72 characters in body; edited tags
Jul
21
comment Demo DB for book on PostgreSQL
The book covers Postgres 7.0 which has been out of support for a very long time. Postgres has changed very much in the last 14 years. Make sure you check out the manual for the current version (9.3 as of July, 21st) as well. The manual also contains a good tutorial on SQL. Another option is postgresqltutorial.com which uses the DVD rental database for its examples: postgresqltutorial.com/postgresql-sample-database
Jul
20
comment Very large btree index with few rows (openstreetmap gis data)
@raph: I didn't mean that the solution was wrong, just that a where access_type is null condition is not required in the query (even if that is used in the index), as long as you compare the column to a non-null value: where access_type = 'foo'. The planner will still make use of the index
Jul
20
comment How do I go about easy table input without creating an application?
Another option would be to use a (before insert) trigger to lookup the corresponding ID during automatically
Jul
20
comment Very large btree index with few rows (openstreetmap gis data)
Just for completeness: for a partial index using is not null you don't have to use is no null explicitly in the query. If you compare against a value where access_type = 'foo', the optimizer is smart enough to recognize that
Jul
18
comment Auto refreshing a query
I understand that, but still you are storing data that can easily (and without any performance penalty) be derived from the existing data: select mark_1 + mark_2 + mark_3 as t_mark from test_1 won't be any slower than select t_mark from test_1
Jul
18
comment Auto refreshing a query
Why would you want to do that? It's usually not a good idea to store data that can be derived from other data. Create a view with that formula and you'll always have up-to-date information. If you really insist on duplicating data, look into triggers
Jul
18
revised Auto refreshing a query
added 4 characters in body
Jul
18
reviewed Reject suggested edit on PostgreSQL: How to list the comments attached to a database
Jul
18
reviewed Approve suggested edit on PostgreSQL: How to list the comments attached to a database
Jul
18
comment Btree index and Bit Map Index
The manual can't be clearer: your options are UNIQUE, FULLTEXT, SPATIAL for the index type. No mentioning of the keyword bitmap.
Jul
17
revised how to view the Image in mysql DB
edited tags
Jul
16
comment Primary key with randomly varying increments (so it cannot be guessed easily)
@frlan: there is an additional module that supplies functions to generate UUIDs: postgresql.org/docs/current/static/uuid-ossp.html
Jul
16
awarded  Good Answer
Jul
16
comment execute .sql script inside an anonymous pl/sql block which is invoked by a shell script
Why not just move the @... lines after the PL/SQL block?
Jul
16
revised execute .sql script inside an anonymous pl/sql block which is invoked by a shell script
added 74 characters in body; edited tags
Jul
15
answered Postgresql: set default psql client encoding