rdbms

Hidden Features of PostgreSQL [closed]

℡╲_俬逩灬. 提交于 2019-11-29 18:33:14
I'm surprised this hasn't been posted yet. Any interesting tricks that you know about in Postgres? Obscure config options and scaling/perf tricks are particularly welcome. I'm sure we can beat the 9 comments on the corresponding MySQL thread :) tommym Since postgres is a lot more sane than MySQL, there are not that many "tricks" to report on ;-) The manual has some nice performance tips. A few other performance related things to keep in mind: Make sure autovacuum is turned on Make sure you've gone through your postgres.conf (effective cache size, shared buffers, work mem ... lots of options

What's the PostgreSQL equivalent of MSSQL's CONTEXT_INFO?

為{幸葍}努か 提交于 2019-11-29 15:44:53
In relation to my other question "What’s the best way to audit log DELETEs?" . What's the PostgreSQL equivalent of CONTEXT_INFO? [EDIT] I want to log deletes using trigger, but since i'm not using the database user as my app's logical user, I cannot log the CURRENT_USER from the trigger code as the user who deleted the record. But for INSERT and UPDATE it is possible to log the record changes from trigger since you can just add a user field in the record, say inserted_by and last_updated_by, and use these fields to log to audit table. Milen A. Radev http://www.postgres.cz/index.php/PostgreSQL

Oracle AS keyword and subqueries

拈花ヽ惹草 提交于 2019-11-29 15:19:27
Just found out that Oracle does not like it when you use the AS keyword to alias a subquery: SELECT * FROM (SELECT * FROM products) AS p I need to keep my SQL queries as portable as possible. Will the removal of the AS keyword in the above query affect any other RDBMS? Jorge Campos The pattern for the SQL 99 ANSI is that the table can have an alias WITHOUT the AS keyword so, you can take out AS and it should work on every RDBMS. See it on fiddle: MySQL Oracle PostgreSql SQLLite SQLServer In ISO/IEC 9075-2:1999 , section 7.6 <table reference> , page 232: <table reference> ::= <table primary> |

Using Lucene like a relational database

人盡茶涼 提交于 2019-11-29 15:11:46
问题 I am just wondering if we could achieve some RDBMS capabilities in lucene. Example: 1) I have 10,000 project documents (pdf files) which have to be indexed with their content to make them available for search. 2) Every document is related to a SINGLE PROJECT. The project can contain details like project name, number, start date, end date, location, type etc. I have to search in the contents of the pdf files for a given keyword, but while displaying the results I want to display the project

Reasonable Export of Relational to Non-Relational Data

笑着哭i 提交于 2019-11-29 13:05:07
We have different products that rely on relational databases for various reasons, basically the transactional nature of the operations (atomicity, consistency, etc.). This is not going to change any time soon. Given this scenario, are there any possible justifications to export the data to a NoSQL solution? Maybe Datawarehousing, Analytics, etc. Any comments are welcome. "Data" is just a vague generality without a data structure. "Relational" means the data structure is relations/tables with generic queries. ( Not automatically interleaved execution of semantically atomic concurrent

Strategic issue: Mixing relational and non-relational db?

前提是你 提交于 2019-11-29 07:04:47
问题 There has been a lot of talk about contra-revolutionary NoSQL databases like Cassandra, CouchDB, Hypertable, MongoDB, Project Voldemort, BigTable, and so many more. As far as I am concerned, the strongest pros are scalability, performance and simplicity. I am seriously considering to suggest using some non-relational db for our next project. However, some teams comprise some RDBMS fanatics, so convincing a hard switch might be impossible in some cases just because of emotional reasons. Also,

Why have object oriented databases not been successful (yet)? [closed]

≯℡__Kan透↙ 提交于 2019-11-29 06:45:22
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . That's the question. Give only one reason you think why have OODB failed or why many systems nowadays still use relational databases. 回答1: Can we answer more than once? Another reason is that relational DB's have a strong foundation in mathematics: from the definition of a

SQL query for point-in-polygon using PostgreSQL

有些话、适合烂在心里 提交于 2019-11-29 04:07:30
I have the following simple table: CREATE TABLE tbl_test ( id serial NOT NULL, poly polygon NOT NULL ) WITH (OIDS=FALSE); I then try to insert a row with a polygon: insert into tbl_test values(1, PolyFromText('POLYGON((0 0, 10 10, 10 0, 0 0))')) And run into this error: column "poly" is of type polygon but expression is of type geometry Which is lame. So my first questions is: Do I really have to cast? Anyway, after casting it works. And now I'm trying to do a simple ST_Contains query: select id, poly from tbl_test where ST_Contains(poly, Point(GeomFromText('POINT(9 2)'))) Which gives the

Efficient persistent data structures for relational database

喜你入骨 提交于 2019-11-29 03:16:36
问题 I'm looking for material on persistent data structures that can be used to implement a relational model. Persistence in the meaning of immutable data structures. Anyone know of some good resources, books, papers and such? (I already have the book Purely Functional Data Structures, which is a good example of what I'm looking for.) 回答1: It is straightforward to modify the ubiquitous B-tree to be persistent. Simply always alloctate a new node whenever a node is modified, and return the new node

Has anyone published a detailed comparison between different in-memory RDBMSs? [closed]

我们两清 提交于 2019-11-29 02:53:34
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . There are quite a few independent and not-so-independent studies comparing traditional RDBMSs but I haven't managed to find any good material on in-memory databases. I am primarily interested in ones specialized for OLTP. So far, I managed to find generic white papers on TimesTen and MySQL Cluster, but I have