Reputation
14,246
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 26 54
Impact
~809k people reached

Apr
10
comment SELECT rows with duplicate values
Which DBMS are you using? Postgres? Oracle?
Apr
10
comment Postgres-XL does not insert rows
Does a simple insert into test1 (id, profile, status, switch_date) values (...) work?
Apr
9
comment Alternative approaches to “primary” record in child table
You can create a filtered unique index to make sure only a single isPrimary exists per customer: create unique index on addresses (customer_id) where isPrimary = 1
Apr
8
comment Is SQL injection a neccesary feature?
"exists because it is possible to execute multiple SQL commands in a single request" - that's not the only way to do it. Think about injecting the condition 1=1 to a query that checks the password: only a single query, but still a SQL injection that will give you access to the system without knowing the password.
Apr
8
comment How to correctly use PostgreSQL to limit multiple and/or concurrent executions of a task
"advisory locks won't help to expire the lock automatically" - how would the lock obtained through an UPDATE expire automatically? If the update is never committed, it won't expire either. Or am I missing something?
Apr
7
comment SQL HELP - Latest date and unique by user
Which DBMS are you using? Oracle?
Apr
7
comment Replace SQL Server with another DBMS
You might be interested in this: datachomp.com/archives/im-leaving-sql-server-for-postgres this: datachomp.com/archives/… and this: facility9.com/2011/12/… (oh: and what exactly do you consider "huge"?)
Apr
6
comment Scalable Relational Database Design
@JohnDorian: not directly related to this problem, but you might want to re-think your choice of MySQL. It lacks many modern SQL features
Apr
6
comment set session - custom variable to store user id
I think the restriction that myapp.user has to be declared in postgresql.conf was removed in 9.2 or 9.1
Apr
2
comment Is Oracle DB licensing needed for a test environment?
But then the OTN License states you can install and use it as long as you don't put that system into production
Apr
2
comment Oracle DB license for only non-production environments
I understand the (OTN) license the same way you do. I think there are two different things to consider: the OTN license that one agrees to when downloading the "free" (as in "free of charge") version and the license that you agree to when buying Oracle (which is what the "other" poster is referring to I think).
Apr
2
comment Slow query over 10mil rows with group by on indexed column
Removing the where clause should make it slower, not faster as it now processes more rows. I guess the reduced time is more caused by file system caching rather than the removal of the where clause.
Apr
2
comment Foreign Data Wrappers & Windows Authentication
As far as I know you can never use Windows authentication if the client is not a Windows host either. For example: Microsoft only ships Windows DLLs for their JDBC driver to enable Windows authentication. Your Postgres server is the client (from SQL Server's point of view) and is connecting from a non-Windows OS. I think you will have a lot less headaches if you switch SQL Server to mixed authentication and use a SQL Server user for the FDW.
Apr
2
comment Slow query over 10mil rows with group by on indexed column
The majority of the time is spent in reading the values (31 seconds for the Seq Scan), the hash aggregates only adds 8 seconds on top of that. You might want to try an index on begindatumtijdvakgeldigheid if the condition for that column reduces the number of rows substantially.
Apr
2
comment Oracle: Traversing a graph of my foreign keys?
@ypercube: I didn't test it, but I would assume the query will fail unless you use CONNECT BY NOCYCLE
Apr
1
comment Why is Oracle's number datatype so HUGE? and why do I seem to have no alternatives?
I guess Oracle thought the space saving is more important than the speed (if there is one at all). In other database you need to choose a different data type if you want to save space when storing e.g. values from 1 to 100. I think variable length numbers make absolute sense. Think about the space a table with 20 number columns needs when you to store 1 billion rows between 1 and 1000 and 1000 rows with a value 999999999999
Apr
1
comment Oracle Database Migration using Oracle SQL Developer
expdp and impdp are probably a lot more efficient than using SQL Developer for this. If you can create a DBLink you don't even need intermediate files for that
Apr
1
comment pg_restore a view
As a workaround: why don't you use select pg_get_viewdef('viewname') to extract the source of the view? I don't think pg_dump does it any different.
Apr
1
comment Can't get Dell PE T420 (Perc H710) perform better than a MacMini with PostgreSQL
I guess a better place to ask this is the Postgres performance mailing list.
Mar
30
comment Oracle: built in SQL pretty-print?
There is no such feature inside the database. Oracle's SQL client "SQL Developer" can do that though