« first day (316 days earlier)      last day (4569 days later) » 

4:44 AM
@gbn should I tsk at you or wag my finger?
0
Q: How to determine if a index is needed?

I have some tables and I want to check if I need to put an index on them. I am not sure how to determine if the index will help or not. Is there a tool that I can use to determine this? I am using ms sql 2008

Does it need to be merged into dba.stackexchange.com/questions/56/… or just closed as a dupe?
 
 
1 hour later…
gbn
5:55 AM
whatever floats your boat
Aye, merge it
@MartyTrenouth table and query at least please
 
 
5 hours later…
11:24 AM
hi guys
0
A: What problems will I get creating a database per customer?

RolandoMySQLDBAI have a Web/DB Hosting client that has 750+ customer databases with the same number of tables (162) and same table structures. Combined, all of my client's customer data total 524GB (95% InnoDB) Imagine all of these databases competing for 13G of innodb buffer pool on nine DB servers via circul...

Rolando says in that answer to stay away from SSDs in high-write environments
can any of you guys expand on that?
 
11:54 AM
@Gonsalu you need to look carefully at MTBF for SSDs - they all have a limited lifetime measured in writes. I know opinion varies on this but for my money you still absolutely need RAID as well. Things are changing all the time though and high end SSDs are far longer-lasting than they were.
And hello everyone :)
 
Hi @JackDouglas :) Thanks, I was thinking of performance and didn't even remember of the MTBF issues
 
12:38 PM
4
Q: How can I efficiently represent inheritance down a tree?

richardtallentI have a database with three "levels" of objects: A, B, and C. Table A has around 100000 rows, B has 500000, and C has 2 million. In a fit of stupidity, I designed the database to use joining tables AB and BC, even though these are 1:m and could have been represented as an ParentA attribute in B...

predicate pushing problem?
 
or maybe have separate indexed views, and do the distinct afterwards?
without knowing the queries he's using it's hard to have a picture of the problem
 
gbn
12:55 PM
@JackDouglas don't know.didn't read it fully coz busy
 
 
1 hour later…
gbn
2:00 PM
Just seen a great offer at the local food shop
On Pie!
3.1 for 2
Sorry. Had to share that one
 
Newbie index question, if I add a clustered index on a column that most queries ORDER BY will query performance be improved?
Table doesn't have a clustered index on it yet
 
yes
instead of a table scan followed by a sort operator
 
gbn
@BenBrocka maybe
he he
 
oops.
haha
 
gbn
If the clustered index is not a good clustered index (numeric, narrow, unique) then you'll affect other queries
 
2:14 PM
it's that conversation if a sort is need or not
oh, it's not
 
@gbn It's a very narrow use table. It's actually a partial copy of a production database for 1-2 users to append data for record keeping
 
gbn
also, if the WHEREs and JOINs are on different columns then the clustered index may be ignore if other indexes cover
@BenBrocka Ask a question with table def then please
 
it doesn't have any indexes yet and SSMS hasn't suggested any from the queries I analyized
Good idea. I hate this table...
 
gbn
is there a candidate key? That is, what identifies a row?
@BenBrocka good man. Share the pain :-)
 
@gbn That's...another problem. There isn't
the current table doesn't use the PK from the original table, I had to tape on an identity column just for it to work with my framework. I'm not even sure if I should include the original PK since the old app didn't, I'm trying to figure out how it even kept things unique
they used app code instead of DB logic so finding out what's going on in the table is a mess
 
2:56 PM
afternoon chaps
@Gonsalu SSDs have moved on leaps and bounds. Consumer spec drives will fail more often than their mechanical equivalents but weighed against the benefits, I'm a BIG fan!
@Gonsalu Basically treat them as disposable
 
hi @MarkStoreySmith
 
1
Q: What is object Server?

KitexAs I was reading article I came across IBM's site about object Server. What actually is Object Server and what are it's uses? Can this be explained for a beginner?

Anybody got some info on IBM servers that can weigh in here? Definitely looking to expand the knowledge base of the site
 
3:21 PM
This different companies thing is a nightmare. Turns out our IT dept is also basically the IT dept for a "competitor" we own 49% stake in. They use half their own IT infrastructure and half our own and there's no consistency.
I just found out about their major database server and it's in Pervasive SQL so I don't even have software to access it
 
3:32 PM
First time I've heard of Pervasive SQL
 
Same here
I...really don't like it
 
JNK
Pervasive SQL is not fun
We use other pervasive tools where I work but they integrate into SQL Server thankfully
 
FFS. Pervasive has got to be the worst version of SQL ever
there's no ALTER PROCEDURE
 
Don't beat me up! I'm not a fan boy of the EAV model but it has it's place :-) Alright back to work. Bye :-)
 
And you use the save button to create the procedure
you know, the one that is supposed to save a script. Instead of executing the damn SQL statement
 
JNK
3:47 PM
@BenBrocka You should use their other tools. We use a mapper they wrote that works OK but the UI is terrible. You have to drag icons in a certain direction sometimes for them to work properly
 
It just took 3 of us ten minutes to figure out how to change 5 letters in a stored procedure
 
JNK
ALWAYS DRAG UP, THEN DOWN! NEVER JUST DOWN!
 
After seeing what they WERE using I really really do understand why they think SS is the best SQL ever
 
JNK
People are so confused sometimes...
0
Q: Programmatically copy index from one table to another, via a stored procedure?

JokerI use a stored procedure to copy the tables from one database to the other database. Right now it does insert into copy select * from original I would like to copy the index from the original table as well. What would be the best way to go about this ?

 
@JNK The UX of the whole application was like being stabbed in the eye with a dull pencil
 
3:54 PM
Hey do we want that post?
 
I see a lot of undocumented stuff being used in the SQL Server world; do you guys keep a list of useful undocumented stuff or is there some sort of list in the wild?
 
JNK
It's hard to migrate stuff here
 
I think we do, it fits better on dba.se
@JNK pfft, you don't know the right people ;-)
@Gonsalu give us an example?
 
JNK
@Gonsalu I don't know of a list but there may be one. I'm guessing you mean things like sp_msforeachdb?
 
@jcolebrand It seems to fit to me. I flagged it
 
3:56 PM
yeah, stuff like that
stuff being DMVs, DBCC commands, stored procedures, etc
 
like the DMVs Remus mentions in that blog post
 
@Gonsalu Are you asking for documentation on undocumented features =p?
 
non-official documentation, yes :)
@JNK, something like that but also for DMVs, etc
I've tried googling, but everything is spread around
 
JNK
You may not find it all in one spot
Also bear in mind it's not always wise to use those since they are undocumented and unsupported
Basically if it breaks something MS will tell you "why do you think it's undocumented"
 
3:59 PM
true
 
JNK
shakes fist tim post!
 
I know that, but it's useful to know them anyway
I was just wondering if anyone had anything like that. Would love to see it :D
 
PS: migrated
@JNK I told you, you gotta know a guy
 
@jcolebrand Yet another user with no account after migrating...it'd be really nice if they'd help that along
is a user even notified when a question is migrated?
 
@BenBrocka yes
@BenBrocka there's a reason for that.
 
4:05 PM
@jcolebrand But are they given a "please login" message when they come to view their moved question?
It's not immediately clear that I even can log in to the new SE site with my old info if I'm not familiar with the system
 
@JNK wot?
 
@Gonsalu DMVs are fully documented. Its understanding the meaning behind the data that takes time/experience
 
@MarkStoreySmith rusanu.com/2011/10/20/sql-server-table-columns-under-the-hood The views mentioned in this blog post from Remus are not documented...
that's one example (or two)
 
I see were you're coming from. What you have there is more internals trivia, rather than something you can usefully apply on a daily basis
 
JNK
@TimPost You're messing up my SO rep man!
 
4:16 PM
Hahaha, technically not until another recalc, @JNK
 
0
Q: How can you exit a powershell script from within a function?

datagodI am writing a powershell script to backup and restore databases. I am using forms to gather user input. At any point in the information gathering process, the user can hit "cancel". To keep things tidy, I moved the form logic into separate functions. Is there a way to "exit" the entire scrip...

Purely powershell questions would be for SO right?
 
JNK
@BenBrocka Should be I think. I'll answer it!
 
@BenBrocka If there was a database context to what was posted, keep it but in this case none of the code is DB related so should be moved to SO.
 
@MarkStoreySmith That's what I meant, nothing about it is directly related to DBA
 
Honestly, my punctuation is usually far better than is reflected in my typing here!
 
JNK
4:31 PM
1
Q: Does "WHERE 1=1" usually have an impact on query performance?

transistor1I recently saw the question "where 1=1 statement"; a SQL construct I have used often in constructing dynamic SQL in an effort to write cleaner code (from the perspective of the host language). Generally speaking, does this addition to a SQL statment negatively affect query performance? I'm not l...

Get it tim!
 
@JNK I have to ask him ;-)
 
@JNK You could just flag and be patient =p
 
@BenBrocka but that's no fun then :p
 
JNK
FINE
You guys are meanies.
 
So what's the deal with Pervasive SQL anyway? I never heard of it before working here and DBA.SE doesn't have a single question on it...
 
4:40 PM
Because nobody likes it? :p
 
When I saw "PSQL" I first thought it was Postgres
 
Isn't it an EAV? Nobody likes to talk about EAV with data pros, they think it's a progger only activity.
 
@jcolebrand For good reason
 
Never you mind that most DBA grok storage like a progger wouldn't believe
 
EVA as opposed to? I've never heard of it either until this chat room =p
 
JNK
4:44 PM
EAV, Entity Attribute Value
An "open ended" data structure
 
I did google it =p I'm not sure how to equate that vs...normal? database storage
 
JNK
Everyone seems to think it is awesome when they first learn about databases, then they discover it's a terrible idea and close their ears
 
is it not relational?
 
JNK
Yeah it's not really relational and it's not DEFINED
which sounds great until you try to run something when all of your fields are varchar(255)
 
EAV != "normal database storage"
@JNK sure it is, depending on your system. Some have rigorous definitions, some don't
@JNK you don't store EAV in a traditional DB, nominally.
 
JNK
4:47 PM
Well it basically uses the relational structure as metadata for your actual structure
 
You can
I can water my garden with a coffee can
 
JNK
@jcolebrand I was talking about using a traditional DB
 
@JNK or sometimes the application knows the relational structure
@JNK which is just nasty nasty implementations of EAV
It's like they wanted to do the right thing, but they didn't understand the concept
 
I don't think pervasive is EVA then, it seems to have switched over to TSQL easily enough, the SQL looked normal enough
 
@BenBrocka you should check out mongo, riak, et al.
 
JNK
4:49 PM
Pervasive is a relational store with a clunky interface
 
It's not clunky, it's a crime
@jcolebrand mongo sounds interesting, not quite what I'd like to get into though
 
oh, you have to design your apps around those things
you can't generally just drop them in
(ok, so you have to design your data layer around them)
 
Exactly, not something I'd want to use =)
Is there any way to make SSMS NOT ask me if I wish to save when closing a query tab?
 
JNK
No. Frequently requested never implemented.
I think there are a handful of connect items about that
 
Everything I try to change in SSMS is like that
like hiding the damn dbo in front of every table, which means I can't type to search my tables from the tree view...
 
5:10 PM
you can, but you have to type dbo. first haha
 
I'm aware, but that's hardly any help =p
 
oh my, it's busy in here
we just overflowed the first row of avatars
dun dun dun
Avatar Overflow
 
Maybe on your tiny screen
 
oh wait
yes
well, on the smaller of my two monitors
we have
dun dun dun
an Avatar Overflow
on my larger monitor it's business as usual
 
5:45 PM
so I've got a 75GB general query log. Now what?
 
Go for the high score?
 
6:41 PM
wow @JNK what a DICK ...j/k, but yes, I work in a small shop
 
JNK
6:55 PM
@DTest - deleted for a reason! Also I thought for some reason you were talking about SQL Server transaction log
 
gbn
@DTest Move to the dark side. SQL Server awaits
3
 
@gbn how does 'work in a small shop' translate to 'hey lets pay lots of cash for sql server' (ignoring the free version :P)
 
gbn
@DTest I'm the blue sky thinker. I leave practical details to others.
 
did you know every time you edit that it keeps desktop pinging me?
 
gbn
"Doinking" you. Ping would be like batfink, with melody and pleasant. Not a broken sofa
 
7:19 PM
Howdy
 
Hello
 
@gbn hahahhahaha yes, it is more a doink than a ping
 
i tend to not use that word: urbandictionary.com/define.php?term=doink
 
gbn
nice. If do*nk is now verboten, what is it?
 
Everything means f**k according to urban dictionary
2
(to be fair in this case it's a term I've actually heard used to that effect, which is amazing for urban dictionary)
 
7:34 PM
@ben agreed, i only linked it because that's how I've heard it used before as well
 
8:10 PM
To create an indexed view in SS do I have to use SCHEMABINDING? I'm trying to create an optimal view for a table without affecting the underlying table at all
 
JNK
Yes you must use schemabinding
which also means all your referenced objects need to be in the same DB as the view
There are a LOT of rules around indexed views in SS
what exactly are you trying to accomplish with it?
 
for indexed views
 
8:48 PM
@JNK A nightmare. I'm probably going to ask a Q about it sooner or later
@MikeWalsh yeah, was reading this article technet.microsoft.com/en-us/library/cc917715.aspx
@JNK We have a program that's using sort of a precomputed view, it copies only relevant data from a large table into a physical "work" table, data's only one way
I've been trying to replace the physical table with a view, but the performance is horrible
can't add indexes on the underlying table/ect as it's a vendor table
 
JNK
9:12 PM
@BenBrocka - Feel your pain, I dealt with that a lot at a prev job. If the data doesn't update regularly that might be a good workaround for now. If you are limited in changes you can make to the underlying tables then there isn't much you can do.
 
The underlying table updates constantly, user (currently) updates it like once a day I think, not that often
the original reason it was a separate table is because it was a separate database as part of an access app
user's used to using it via the "update button"but I'd rather avoid that, but the performance is pretty bad
 
JNK
I would say post it then, I have a relatively narrow experience (mostly data warehousing) so one of the pros can hopefully provide better insights
 
I've been focusing on the interface and programming as long as I can to avoid it.I really want the view to work
 
JNK
Post it, we can probably help.
something I DO know a lot about is performance tweaking :)
 
FFS. I shouldn't have been worried about putting an index on the underlying table, these people have already put multiple identical indexes on it
 
JNK
9:29 PM
You need to have more than one just in case the first one doesn't work right!
 
haha
 
They're even named the same! index_1 and index_2
WTF
 
JNK
I have seen indexes named [<Name of Missing Index>] so don't be too upset
 
Lol, I didn't think it'd let you save it as that
Well I guess it's got brackets. If it's got brackets it's fine by SS
 
JNK
If it's in brackets you can
I've also had five identical indexes called joe_1 joe_2 joe_3 joe_4 joe_5
guess the name of the person working on that table!
 
9:35 PM
Yeah, I have one of those too
is the 1 automatically appended or something?
There are 4 duplicate indexes on this table and they're all index1 index2
 
JNK
Unsure
I doubt it, it probably was manually done
Index1 Already exists!
CREATE INDEX Index2...
 
lol
Yeah, that wouldn't surprise me
Do duplicate indexes harm selects at all? or just data manipulation?
 
JNK
just inserts/updates/deletes
still not cool because of space issues
 
That's what I thought. Was hoping though because this table is slow as hell
 
JNK
Have you checked execution plans or traces?
 
9:43 PM
Only for the queries in my app. I can improve query cost up to 70-90% on some of my selects, but it's still slow
I guess in part it depends on the queries my user creates, it's a search/reporting thing and I don't know exactly what all they'll do
If I can get the index down and narrow down their possible queries it might run acceptably well
 
JNK
open-ended apps like that are a nightmare to tune
we have something similar, where the users want to be able to sort/filter on any field
this is in a denormalized view that has like 150 fields in it
 
Sorting isn't a problem, can do that client side. In fact I could totally omit ORDER BY if it would help (it doesn't) I just need to fetch a massive pile of data
Oh hell, this is less than 10 columns, the underlying table has like 50 though
I'm a liar, 15 columns, only 4 search fields. It shouldn't be this much of a nightmare
 
JNK
This is a 600m row table that's like 1.5TB. so, it could always be worse!
 
10:08 PM
Haha. Definitely, this is only a 3m row table...shouldn't be this slow though
actually looking at it again I think part of it is my damn database driver the website is using
 
10:23 PM
A whole bunch of these indexes are called "webindex"+number and are duplicates. Think something is doing that automatically or someone was really unimaginative with names?
 
10:58 PM
@DTest Neat
 

« first day (316 days earlier)      last day (4569 days later) »