Learning About Indexes The Hard Way
Oct 18, 2006
Hello, I am experimenting with indexes and hope people can shed light
on some of my problems.
I am using SLQ 2000 on Win 2000 Server. Using the following query for
discussion;
--------------------------------
SELECT TOP 1000000
E.EUN_Numeric, -- Primary Key
E.EUN_CODE, -- VarChar
E.[timestamp] --,
--E.Model -- Computed column (substring of EUN_CODE)
FROM dbo.Z1_EUNCHK E
--WHERE E.[timestamp]DATEADD ( wk , -48, getdate() ) AND
-- E.[timestamp]< DATEADD ( wk , -4, getdate() )
ORDER BY E.[timestamp] DESC
-----------------------------------
Problem 1) If I set up a single Index on the TimeStamp (plus the PK on
EUN_Numeric) then there is not improvement in performance.
It is only when I set up an Index on the Timestamp,EUN_Numeric,EUN_Code
then I get a good improvement. This is also the
case with the "where" clause added. I am using query analyser. The
improvement is 14 secs to 3 secs (mainly with the removal of the sort
process)
Why?
My expectation is that if my query uses [timestamp] column then surely
an index only on this is adequate.
Problem 2) Introducing the simple computed column into the query takes
the time to 15 secs (with Sort processes involved).
Why does revert back to sorting process when previous the index was
used ?
Regards JC......
View 6 Replies
ADVERTISEMENT
Jul 1, 2014
I'm working to improve performance on a database I've inherited, and there are several thousand indexes. I've got a list of ones which should definitely exist within the database, and I'm looking to strip out all the others and start fresh, though this list is still quite large (1000 or so).
Is there a way I can remove all the indexes that are not in my list without too much trouble? I.e. without having to manually go through them all individually. The list is currently in a csv file.
I'm looking to either automate the removal of indexes not in the list, or possibly to generate the Create statements for the indexes on the list and simply remove all indexes and then run these statements.
As an aside, when trying to list all indexes in the database, I've found various scripts to do this, but found they all seem to produce differing results. What is the best script to list all indexes?
View 5 Replies
View Related
Dec 1, 2006
Hello All,
I am new to this forum as well as sql. I want to learn skills with SQL. Can anyone point me to the right direction for some free pdf's/learning notes.
Thanks in advance.
sqlnewbie.....
View 5 Replies
View Related
Dec 12, 2006
Hi, not sure if this is the right place to put this but as its the beginners forum I thought I'd take a chance.
What's becoming more evident to me is my weak SQL skills. I'd like some advice on the best place to learn properly. It's starting to become a part of my role and i'm struggling a bit.
Should I go on a course? I have a number of teach yourself books and an evaluation version of the software but is this enough? I've worked through the books but struggle to apply the book to the real situation i.e subqueries
How did the more proficient of you learn SQL?
I want to get to a stage where I can help others with their SQL problems rather than always being the one helped.
Any advice much appreciated.
View 7 Replies
View Related
May 10, 2007
Hello
I am considering taking an on-line course in SQL, such as...
http://www.transcender.com/product.aspx?product%5Fid=Pak%2DMCDBACORE&dept%5Fid=100403
I do not work with SQL but I do have good computer knowledge and experience of MS Access and visual basic. Would it be plausible for me to complete such a creditation without the work experience or is it asking too much? I have a lot of time to focus on it at the minute. Does anyone have any knowledge of this particular company or can you recommend a better one?
Also, is there any way I could complete this course on a Mac (pre intel)?
Any help/info will be greatly appreciated.
Thanks
View 6 Replies
View Related
Jan 31, 2008
I am thinking about doing a computer course.It is learning about sqlto become an MCDBA.I am trying to find out how difficult this could beas I will be doing it from home and it is going to cost over £4000 forall the CD ROM's,books etc.You understand I don't want to start thecourse only to find I can't do it.I have owned my own computer for 18months and enjoy it.If anyone with experience can reply it would beappreciated.
View 4 Replies
View Related
Apr 21, 2007
I started a course and got to the lab section. It asked for a password giving me the name of student. I don't know if I was given a password when subscribing for the course. Certainly no in the confirmation email.
Where did I go wrong?
John.
View 6 Replies
View Related
Jul 26, 2006
I have four questions about Tsql language:
1. Is it important for a web developer to learn Tsql ,if he uses Data driven sites or just learn (select ,update,insert,order by ...I mean the most popular statements) ?
2. Where to learn Tsql ,is there any free books ,videos,tutorials,articles ,websites (ofcourse sql server 2005 with it's enhanced Tsql syntax?
3. Can I use a Tsql generator tool or Builder instead of learning the language ?
4. Where I can find such a tool?
If you do not know all the answers ,tell me what you know ,I will appreciate all the answers,and plz need help from the moderators also.
Thanks
View 2 Replies
View Related
Jan 1, 2007
I'm used to programming in PHP and need helping learning how to do SQL stuff in VB (using Visual Studio Pro, if that makes a difference).
For instance, in PHP I might do something like this:
//some code to connect to the database
$result = mysql_query("SELECT * FROM `table_name` WHERE `some_field` = true") OR die("ERROR: ".mysql_error());
while ($row = mysql_fetch_assoc($result)) { extract($row); //do what needs to be done with the variables}
How can I do that in Visual Basic?
This is what I have so far and that's only from cutting and pasting from some websites. 1 Using connection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True")
2 connection.Open()
3 Dim command As SqlCommand = New SqlCommand("SELECT * FROM GE_Data", connection)
4 'now how do I get to the data???
5
6 connection.Close()
7 End Using
-Mathminded
View 2 Replies
View Related
Jul 28, 2000
Any recommendation on a book for a new DBA to learn about SQL Server 7.0 replication?
View 2 Replies
View Related
Jul 8, 2000
I'm looking for a book or a couple of books to learn SQL (in general aswell as various versions from different vendors). A couple of books that would take me from beginner through advanced topics. Any good suggestions?
/ ludde@freebox.com
View 1 Replies
View Related
Apr 14, 2006
Hi, I am new to this forum. I have a question about learning SQL. I never really had much of a reason to learn anything dealing with server programs. I now would like to learn about SQL. Is there a program that anyone knows about that can help me learn?
View 7 Replies
View Related
Apr 26, 2004
Hi Guys,
Well, as a VB/VBA applications developer I'm not well prepared for this, but it looks like I will be riding herd on a production SQL Server.
TSQL I know well enough to get along, but where can I get a fast fix on all the logins, security, and process management info? Today we had a DTS package crash overnight and it took me forever to figure out that it had left half a dozen tables locked. (Note that the scripts for the DTS package are being re-written as we speak with use of transactions and NOLOCK.) Meanwhile tech support was handling a whole mess of grumpy users.
Are there any books you would recommend as resources/references? Is there a particular author who is good at writing the stuff you really need to know in English that can be read by a mere mortal like I? I am fond of the Microsoft resources/help files but I'd like to have somthing that holds highlighter and post-it flags a bit better. Not to mention something that focuses more on the beast as a whole rather than the minutia at length.
Thanks for any suggestions!
View 14 Replies
View Related
Apr 24, 2006
Hi:
I'm an aspx programer, mi database is in access.
I want to learn sql server enterprise in order to improve my aspx's and databases but I dont know where to start learning.
I have downladed a tutorial from microsoft web site but I dont know what topic learn first
SQL Server Tools
Analysis Services
Data Mining
Integration Services
Notification Services
Reporting Services
What topic I must read first? I just want make an aplication to read and update data from a database.
Do you know another good totorial on the web?
Thanks!!
View 3 Replies
View Related
Sep 9, 2006
Hi,I have been trying to register for E-Learning for MS-SQL2005 ... but IE aborts any time before the registration is finished ... (after sign-up, or information fill up, or before those steps): "Microsoft Internet Explorer a rencontré un problème et doit fermer. Nous vous prions de nous excuser pour le désagrément encouru.". I don't believe this working as designed despite this pb shows me that Microsoft has still progressed to make in quality ... (my computer is running W2K and is up to date with Windows Update).Any idea to access knowledge courses on internet for MS-SQL2005 are welcome :) Jean-Marc
View 4 Replies
View Related
Mar 21, 2007
I discovered that many of my very busy colleagues are having anextremely difficult time pulling themselves away to take vitaltraining when it requires being away for consecutive days. I justcompleted training for .NET in Chicago through a mentored learningprogram that personally helped me to tackle that same issue. Thoughthe mentored learning training allows complete interaction withclassroom version labs and interaction with an on staff expert on thetopic, it does require some discipline in that I was responsible forthe pace I was moving. The benefit for me is that I did not have tocommit myself to a set schedule of consecutive days beinginaccessible. I had the flexibility to engage in the mentoredlearning program once a week until I completed the course. Plus thementored learning lab was very comfortable and for some of mycolleagues who would are able to travel, it is near O'Hare Airport andthere is a hotel next door.Once I get more help in our data center, I do plan on spending sometime, and some of our firm's money on some instructor-led classes thatwill require me to be away for consecutive days and I can get done alot quicker. This particular training centers line-up of classes andits personnel impressed me. I thought I would alert the rest of youto this attractive alternative and would be happy to provide you thedetails on a need to know basis either through this discussion groupor you can send me an email to Join Bytes!.
View 1 Replies
View Related
Jul 20, 2005
Hi group.I have been working with ColdFusion and SQL Server for some timenow....abour 4 years I guess. I have developed various web applicationssuccessfully. The scenario I am in is that a company would like me to comeon with them as a lead database admin type guy. I would still do a little CFdevelopment....but mostly it will be data management with SQL Server.Now....like I said...I have worked with databases for quite awhile...specifically SQL Server, and I am quite comfortable with it......butIm kinda worried that the position involves a lot more than I have done.Mind you I will have first hand knowledge of the database in place which iswhat this position is for....so I have somewhat of an advantage. But....Imjust wondering if I should do a short course that teaches me the ins andouts again. It's like I develop databases by winging it. Know what I mean. Ithink I know what I am doing...but what if I don't? Just wondering what yourthoughts are.
View 6 Replies
View Related
May 8, 2006
could we download the videos of SQL Express learning resources as we can do it with the VWD, VB, C#????
there is another link to do it???
will they be available in a short future?
View 1 Replies
View Related
Jul 2, 2007
Can somebody tell me if the microsoft time series (MTS) algorithm use the unknown p approach in order to learn an ART model, cited in Autoregressive Tree Models for Time-series Analysis by Meek, Chickering and Heckerman ?
If the answer is true, what is the pmax that the MTS algorithm uses?. Is there a parameter to control this value?
If the answer is false, what approach MTS algorithm uses in order to learn the structure of a ART(p)?
Thanks for your help.
View 1 Replies
View Related
Mar 21, 2008
Hi,
I am new to SSIS.
1) I want to create a SSIS package to execute 5 stored procedures one by one. Stored procedures has parameters.
2) I want to create a SSIS package for ETL. To extract data from different tables from a database and insert into a new table in the same database on a monthly basis. How do i do these two?
Is there a good material i can go through to achieve these tasks?
Thanks in advance
View 5 Replies
View Related
Aug 13, 2004
Can anyone tell me about some good online tutorials for learning stored procedures in SQL Server 2000?
Any help will be greatly appreciated.
Thank You.
View 1 Replies
View Related
Jul 7, 2007
Hi All,
I have Oracle 9i personal edition on my laptop which I use to learn Oracle/SQL including creating and quering tables. With this I have been able to go into jobs confident with being able to query Enterprise implementations of Oracle in a commercial environment.
Now I would like to learn Microsoft/SQL and I was wondering whether Microsoft's SQL Server 2005 Express will be enough for me to learn MS/SQL like Oracle personal edition has.
Regards,
Seaweed
View 12 Replies
View Related
Sep 5, 2005
aj writes "Hi.
I'm very interested in learning SQL and SQL Server 2000. I am of above average intelligence, but have no prior programming experience. I am curious as to how long this may take to learn/establish "the basics". I apologize in advance if my question comes off as being foolish.
I've read that you're able to successfully use SQL Server 2000 without prior SQL experience. Is this true?
Ultimately, what would anyone suggest in terms of how to begin the learning (self-teaching) process? What are some good, recommended resources I may use either on-line or purchase, i.e. video tutorials, books, software, etc, etc. Any info or assistance would be greatly appreciated. I've run across an SQL Server 2000 tutorial video online and am considering purchasing it. The demo clips seemed well organized.
I appreciate any advice, suggestions, and recommendations.
Please feel free to email me directly.
Thanks!
- Struggling newbie
View 2 Replies
View Related
Dec 1, 2006
I'm pretty familiar with SQL syntax. I am interesting in learning more of admin information.
I've got a lot to learn here and would like some discussion and/or links to helpful sites.
One of the most important things:
I'm trying to understand how the heirachry of groups and users work better. I noticed it is integerated with our active directory from windows server 2000. Is this just becuase of I choose intergrated security when I installed this?
I have many other questions but I would like to try and understand one thing at a time before moving on, so somebody encourage this discussion with me!
View 1 Replies
View Related
Dec 5, 2007
Hi,
Can any body tell me how can I learn about Sql. I am now a days learning asp.net using C#. bUT can not under stand how to work with database.
Can any body tell me the online book that is easy to learn (Examples etc ).
Feejaz.
Navi
View 6 Replies
View Related
Dec 31, 2007
I am using the book SQL Server 2005 Analysis Services by Reed Jacobson and Stacia Misner Step by Step.
For building My First Cube, in the Cube Wizard, when the Radio button is checked for "Build the cube without using a data source", the Checkbox for "Use a cube template" is dimmed.
How do you remove the dimming so that the database "Adventure Works Standard Edition" can be entered for providing the template.
I find two files of Adventure Works in Visual Studio 8Microsoft.NET Framework... and three more Adventure Works files in in Visual Studio 8SDK....
Somehow the Adventure Works is not in the right path?
Thanks in advance for some help.
Norman Snowden
View 1 Replies
View Related
Jul 23, 2005
I am a retailer whose software back-end has just been upgraded from Accessto SQL Server 2000. (The front-end is an independently-written shop Point OfSale system)While I know a fair bit about computers, I know nothing about SQL Server.And frankly, I don't want to know much. I don't need to build any newdatabases, program SQL, or "be an administrator". All I need to know aboutis how to go into the raw data like I did in Access and change that data.(The front-end software has some limitations, and I have found it easier inthe past to go into the dB through Access and search-and-replace, andgenerally edit the data as though I was in Excel).What is the easiest and quickest way to learn the skills I need for doingthe same thing under SQL Server 2000?Is there a particular book or site that you could recommend?Is there in fact a tool in existence that mimics Excel in the editing of SQLdata??
View 7 Replies
View Related
Feb 9, 2007
How can I practice the use of SQL server without changing mygirlfriends laptop to XP Pro (which anyway I dont have)?Using (unfortunately) Windows XP Home not Pro, Visual Studio 2005.Trying to learn SQL server with asp, javascript, vbsrcipt and HTML-new to this.Headbutted the wall for a few hours trying to install SQL Serverproperly. The long and short is no IIS with Win XP Home so doesnt seemto work properly. I did manage to connect to Northwinds and publs DBso can use them to learn but I need to be able to ceate own database.Ie 3 tables.For the moment I have created a table in Northwind which I will try tofill with datafrom a notepad file I have...Dan
View 2 Replies
View Related
Feb 16, 2006
Hi all,
Not sure if this is correct place to post this thread but im looking for advice on where to start with learning SQL and C# as i wish to start in a new career as a DBA.
Cheers,
View 5 Replies
View Related
Mar 30, 2007
We've been working hard with our teams here to get better/more/good information out to our users. We€™ve created a new a customized Windows Live search, that limits results to Books Online. Check this out, and make sure you let your contacts know to visit it and provide feedback:
http://search.live.com/macros/sql_server_user_education/booksonline
We want to generate as much traffic as possible here so that we can see if this is useful to our users. We€™d love to hear back from everyone we can!
View 8 Replies
View Related
Sep 14, 2006
Hi,
Still using 2000; I'm trying to figure out where to even start with optimization in SQL queries. BOL is very confusing to me on this point. I ran the following query with and without and index as seen below. Is Trace a good place to start?
DROP INDEX OrdDetails.OrderID_ind
GO
CREATE INDEX OrderID_ind
ON OrdDetails (OrderID)
GO
select count(*) from OrdDetails = 6467155 rows
GO
-- query; without index Duration 156; CPU 95; Reads 54
-- query; with index Duration 66; CPU 15; Reads 97
select OrderID, Count(OrderID) AS OrderIDCnt from OrdDetails
group by OrderID
having count(*) > 1
GO
Why are the reads more with the index? This is just a simple non-clustered index, which I believe is the default. Should I be starting elsewhere to find out this info?
thx.
Kat
View 3 Replies
View Related
Dec 26, 2007
Hello,
Could anyone please suggest a good resource to learn and practice various concepts of SQL like stored procedures etc.? I tried looking at www.w3schools.com but it doesn't seem to go into the details of stored procedures, triggers, cursors, roll backs, commits etc.
Thank you.
View 1 Replies
View Related
Feb 25, 2005
Hi
I'm learning by going through the tutorials and such and modifying the code to try and learn how to do more and different things.
I have a MSDE Database, and I'm building a query from the WebMatrix Code Builder.
I can get a Select and Where to work on a "Category" colum as String; to return from a text box control (where I enter the name) and on button click.
What I would like to learn how to do and am having trouble is do a select Where "Category" (string) and "Status"(Int) are the same.
I have two Seperate Textboxes after i make the Where / And Query, but I'm not sure i have the button click code right.
I have included the code below - Sorry if this is so basic ;-) - The Sub_Button1 Click is at the end.
Function ShowRecords(ByVal category As String, ByVal status As Integer) As System.Data.DataSet
Dim connectionString As String = "server='(local)'; trusted_connection=true; database='SalesContacts'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT [Contact].* FROM [Contact] WHERE (([Contact].[Category] = @Category) AND ("& _
"[Contact].[Status] = @Status))"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_category As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_category.ParameterName = "@Category"
dbParam_category.Value = category
dbParam_category.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_category)
Dim dbParam_status As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_status.ParameterName = "@Status"
dbParam_status.Value = status
dbParam_status.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_status)
Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
Sub Button1_Click(sender As Object, e As EventArgs)
DataGrid1.DataSource = ShowRecords(CStr(TextBox1.Text)&(CInt(TextBox2.Text)))
DataGrid1.DataBind()
End Sub
View 4 Replies
View Related