11,638 reputation
11945
bio website
location Munich
age
visits member for 3 years, 4 months
seen 2 hours ago

Sep
8
comment Optimizing large database query (25+ million rows, using max() and GROUP BY)
@Mihai: no, it only has a bitmap index scan (that is it generates the bitmap index "on the fly")
Sep
8
comment Optimizing large database query (25+ million rows, using max() and GROUP BY)
Could you elaborate how a recursive CTE is going to be faster (or even: how it would solve the problem in the first place - I have never thought about recursive CTEs for a "max" problem)
Sep
8
comment Select latest record for each ID
You should mention that your solution only works on SQL Server (due to some non-standard syntax elements)
Sep
8
comment Select latest record for each ID
Which DBMS are you using? Postgres? Oracle?
Sep
7
comment Merge 2 SQL statements into 1?
mysqlperformanceblog.com/2006/09/06/…
Sep
7
comment Merge 2 SQL statements into 1?
I fail to see the reason for two queries. What's wrong with select uid, rid, rating from ratings?
Sep
6
comment Postgresql - Do Foreign Key Constraints Automatically Create Indexes?
Please show us the full create table script
Sep
6
comment What is the correct format to do this?
What is your question?
Sep
6
comment repmgr: Can I replicate databases from two different masters to a third slave?
No, I don't think that is possible. because a slave is always a 1:1 copy of the master. There is no way to merge two masters into one slave with Postgres (and remgr doesn't extend the abilities of Postgres' replication, it only makes it easier to use)
Sep
6
comment How to count the rows from 1 table but from two different column
Added sql-server tag based on the non-standard syntax
Sep
5
comment Drastic change in query speed when changing from Oracle 9i to ANSI outer join syntax
Do you see the slow execution on 9i or 10g? Why are upgrading from one unsupported version to another unsupported version?
Sep
5
comment Drastic change in query speed when changing from Oracle 9i to ANSI outer join syntax
Please post the execution plans for both versions. 9i? Really? Why not upgrade to a supported version? 9i was known to have several bugs related to the newly introduced JOIN operator.
Sep
5
comment mysql join not working as expected
You are mixing the explicit JOIN operator with implicit joins in the WHERE clause. That is a really bad idea (and any other DBMS would simply reject the invalid SQL). The condition for a JOIN operator needs to be defined using the ON keyword right after the JOIN. Plus: your group by is invalid as well (and again every other DBMS would reject the invalid statement). For details see: mysqlperformanceblog.com/2006/09/06/…
Sep
4
comment Disable all constraints and table checks while restoring a dump
@MarcusJuniusBrutus: if you feel pg_dump should generate different DDL for check constraints (e.g. adding all of them at the end) you should post that to the Postgres mailing list as an enhancement request. But I do agree with Erwin that you are mis-using check constraints for something they were not designed for. So I wouldn't expect that change request to be implemented in the near future. Btw: your SSCCE would be better modeled using a foreign key between the two tables.
Sep
3
comment PostgreSQL equivalent of MySQL query variables?
@Daniel: if you are serious about learning SQL you should really get used to that. A single statement is almost always faster than two separate statements (not necessarily in MySQL which is optimized for many, small and simple statements. Most other DBMS have much better optimizer and perform better with fewer but more complex queries)
Aug
31
comment How to put more than 1000 values into an Oracle
In short: you can't. There is no way to overcome this limit. You need to either use a temporary table or send multiple statements.
Aug
31
comment How to put more than 1000 values into an Oracle
Cross post: stackoverflow.com/questions/25592436/…
Aug
30
comment Postgres_Failover Not Working
Have look at repmgr. It is a really cool tool that makes setting up replication and doing the failover much easier.
Aug
29
comment Error while inserting values in array in Postgresql
You should define V_RECORDS_IDS as varchar(32)[]. Using char (or character) is almost always a bad choice (not to so say a mistake)
Aug
28
comment MySQL JDBC does not behaves as the MySQL Workbench
Unrelated but: it doesn't make sense to start a transaction for DDL statements in MySQL. You can't roll them back anyway.