Reputation
23,963
Next tag badge:
99/100 score
31/20 answers
Badges
5 42 84
Newest
 Necromancer
Impact
~963k people reached

5h
comment Is there any point in specifying the precision and scale of a number for a foreign key?
And I might be wrong about the 1.00000...0000 : sqlfiddle.com/#!4/f68a4/13
5h
comment Is there any point in specifying the precision and scale of a number for a foreign key?
I agree with @a_horse_with_no_name. The linked page has as example the value of the expression 3*(1/3) which results (for some unknown reason due to the implementation) to different values, 1.000 or 1.0000....000, depending on the precision of the column: sqlfiddle.com/#!4/f68a4/1
6h
comment Adding order by to a query is slowing down the query even after Indexing
Just noticed that you also have pd.receipt_time_stamp between '2015-03-01 00:00:00' AND '2015-03-30 23:59:59'. A wild card search on a datetime/timestamp column makes no sense.
14h
comment Circular dependency in schema or boolean with CHECK?
The 2nd is also not complete. You need a partial index to ensure that only one of the remotes has is_origin set to true.
14h
comment Circular dependency in schema or boolean with CHECK?
The current create table scripts (1st solution) allow for a repository to have a remote origin that is related to a different repository. I don't think this is wanted.
14h
comment Circular dependency in schema or boolean with CHECK?
If your question is similar to the questions above (i.e. you a repository has many remotes but only one of them is declared the "origin"), then the repositories -> remotes FK in the 1st solution is wrong, it should include two columns.
14h
comment Circular dependency in schema or boolean with CHECK?
And the answers here: How to have a one-to-many relationship with a privileged child? - but keep in mind that they are for SQL-Server, which has not deferrable foreign key constraints - so the circular dependency is really unadvisable there.
14h
comment Circular dependency in schema or boolean with CHECK?
Check this: Complex foreign key constraint in SQLAlchemy (the answer by Erwin).
16h
comment Alternative when IN clause is inputed A LOT of values (postgreSQL)
possible duplicate of Ways to speed up IN queries under PostgreSQL
17h
comment Adding order by to a query is slowing down the query even after Indexing
pd.receipt_time_stamp like '%2015%'? This makes any index pretty useless. Why not pd.receipt_time_stamp >= '2015-01-01' AND pd.receipt_time_stamp < '2016-01-01' so index can be used?
17h
revised Adding order by to a query is slowing down the query even after Indexing
added 332 characters in body
19h
comment Query to update datetime field with yesterday's date
Please don't post a new question for the same issue. You can edit the previous one and clarify it.
1d
comment Convert date in date list condition to list of date ranges
Please state that the answer is for Oracle, not a general one.
1d
reviewed Close Split Column Sentence Into Word
1d
reviewed Close Transfer data to New Laptop
1d
reviewed Close JDE Enterprise: How to grant a user role to use statistics on the remote server
1d
reviewed Close How to use Oracle developer sql query in php?
1d
comment Why Update trigger makes Insertion slow in mysql?
How do you do the inserts? One row per statement?
2d
comment In Green Plum(GP )how to add a column with same data for all the rows described in select query?
Show us the exact query you run and the exact error you get.
2d
revised In Green Plum(GP )how to add a column with same data for all the rows described in select query?
added 57 characters in body