Reputation
3,994
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
6 18
Impact
~298k people reached

May
22
comment Is there some tricks to better index a URL column in postgres?
You can also try function based index , Postgres seems to support it: postgresql.org/docs/9.1/static/indexes-expressional.html
May
21
comment Deadlocks due to foreign keys (MySQL)
I think you need to provide more details to get the answer, for instance deadlock trace and definitions for the tables involved in deadlock. In general, deadlocks attributed to flaw in application logic or ad-hoc queries (other reasons, e.g. lock escalation and an option not to have indexes on FK columns are not applicable to Mysql ). Without any details except that removing FK constraints from DB helped, two options seem most likely to me - either having CASCADE actions specified in constraints or not using @DynamicUpdate/@DynamicInsert annotation in entity classes.
May
15
comment Modeling Optional Foreign Key from Composite Primary Key field (Oracle Data Modeler)
Then you need to redesign table structure. If MKT_DATA_BONDS can have records which are not in BONDS then it implies BONDS is details table and needs FK to MKT_DATA_BONDS . However, FK in Oracle must refer to unique constraint in the main table (not to part of constraint)
May
15
comment Modeling Optional Foreign Key from Composite Primary Key field (Oracle Data Modeler)
What do you mean by "We don't want the BONDS table to contain all bonds)." ? What should be stored in "BONDS" then ?
May
14
awarded  Popular Question
May
13
answered How does the table scan in an UPDATE WHERE predicated on an unindexed column work?
May
13
comment Help on deciding how to pick Correct Index
@Spörri : Without execution plan you cannot tell for sure whether subquery is executed multiple times. Optimizer will very likely generate exactly the same plan as your version with join.
May
10
comment Index on Column with only 3 status?
Index on column with data skew may cause quite a few problems for optimizer... I think filtered index ( in case of SQLServer) will be a better alternative.
May
7
answered Selecting different values from different columns
Apr
29
comment Identity seed increased when using IDENTITY_INSERT
Not a solution, but I'd rather make a decision about reseeding identity value with IDENT_CURRENT than based on version.
Apr
28
comment Database design/structure for address details
You may also want to check Universal data models, namely Party-Role-Relationship. Short article about the topic, tdan.com/view-articles/5271
Apr
25
comment When there is a composite index and those columns are in query, does it use index seek?
If the index is clustered then it's gonna do clustered index scan (not seek!) which simply means full table scan. In other cases index scan is very unlikely path (assuming the table has other columns, not just year, month, and date).
Apr
21
answered Why does “DELETE WHERE (VARCHAR)=0” execute successfully?
Apr
8
awarded  mysql
Mar
31
comment Student Attendance, null not returning
@Ali Shaikh : search for pivoting.
Mar
30
comment Student Attendance, null not returning
@ Ali Shaikh: something like AND attendance.Date IN ( '2015-03-30','2015-03-31') should do the job.
Mar
30
answered Student Attendance, null not returning
Mar
27
comment In USER_INDEXES but not in USER_IND_COLUMNS
LOB ? orafaq.com/forum/t/80334/2
Mar
17
comment Joining two inline functions, slows considerably when filtering on second function
@Jweaver: You need to check actual execution plan in each case to get an exact answer. I'd guess having WHERE on low cardinality column (such as bit or varchar2) makes impossible to use index even if it exists. Quite opposite with datetime column which I expect to have way higher cardinality. Even without index SQLServer may have statistics on this column which causes choosing much better and faster execution plan.
Mar
13
comment Inheritance of unknown type at creation time
Not sure if there is an online version, but search for "The Data Model Resource Book" by Len Silverston.