1,413 reputation
622
bio website
location Austin, TX
age 33
visits member for 3 years, 4 months
seen 1 hour ago

1h
comment What does “schema” mean?
In what RDBMS? They're somewhat between Oracle and MS SQL, for example.
5h
comment I have this two models, which one is better?
Casting it once to save it to the database is normal. Presumably you'll be reading your data multiple times, however, so it would be helpful to not have to CAST again every time you do so. 50 sparse columns is a lot, but NULLs take up very little space; MS SQL offers the SPARSE flag which reduces it to zero (stackoverflow.com/questions/1398453/…); what's your RDBMS?
5h
answered I have this two models, which one is better?
6h
comment I have this two models, which one is better?
In the first model, you're storing an opaque binary and using an auxiliary table to interpret it correctly, while in the second model you're storing the value once in the correct column while leaving the other formatted columns empty. Is that right?
7h
answered Slow querys on billions-rows-table // index used
7h
comment split string for calculations
This is covered on StackOverflow: stackoverflow.com/questions/2647/…
2d
comment how to design a database for an online store?
I'm afraid this question is too broad for this site. If some specific part of the design is giving you trouble, post the details and we can offer suggestions (check for existing questions first, though, please!).
2d
comment insert row if table is empty, else update row (mysql)
Similar, may be helpful: stackoverflow.com/questions/15476851/…
2d
comment insert row if table is empty, else update row (mysql)
"Unable to get it working" is a little vague. Are you getting a syntax error? A run time error? Is it running, but always following the first branch of your logic, or always the second? Offhand, I don't believe MySQL recognizes table is empty.
Sep
24
comment Change table scan in query plan to seek
Certainly. I hope that's not what's happening when you use IN; disallowing index use when a filter is expressed this way seems like a poor choice, especially if you can't use index hints! If that's the case, you may have to fall back on the UNIONs idea (but I'd try the high-cardinality index first).
Sep
24
comment Change table scan in query plan to seek
You do have broad indices, but not in the right order. Putting your most selective fields first can make an enormous difference in an index's effectiveness.
Sep
23
answered Change table scan in query plan to seek
Sep
22
asked How do I grant the privilege of connecting to SSIS?
Sep
22
answered How do I grant the privilege of connecting to SSIS?
Sep
15
comment “Transitive” keys
@bob.sacamento: if you're not comfortable reading and writing DDL, that's a strong reason to stick to the simpler solution A. It's a perfectly good and common setup.
Sep
15
revised “Transitive” keys
Added a schema to illustrate the OP's dilemma (if I understand it right)
Sep
15
comment “Transitive” keys
I took the liberty of creating simple DDL scripts for your two scenarios; if I've misunderstood anything, please correct me. I see two issues: the first model is simpler, which is worth a lot. Second, the second model involves a two-barrelled foreign key from the C table to the B table. Offhand, I don't know which RDMSs support such an FK. Of course you could have a single-column field to physically back up what is conceptually a two-column join, but if you end up doing that, what have you gained?
Sep
15
suggested suggested edit on “Transitive” keys
Sep
11
comment Index optimization for table that is truncated every day
A table should almost always have a PK, but there are many cases where a clustered index is not needed. MS SQL unfortunately does not help by conflating the two. There are several good questions here on DBA regarding these issues.
Sep
10
comment Index optimization for table that is truncated every day
Absolutely. My preference is to pull in data in all its ugly rawness first, often into a heap table, then do SQL cleanup before copying it to a new table. Maybe that's just because I'm a SQL guy and everything looks like a nail to me, but SQL is optimized for set-based operations. On the other hand, if the volume of data is huge you may need to do conversions and cleanup on an RBAR basis as you import it via SSIS or whatnot.