Showing posts with label feature. Show all posts
Showing posts with label feature. Show all posts

Wednesday, March 21, 2012

Open Table Query's Capabilities

I'm using the Client Tools installation.
The Open Table Query feature on a table (by right clicking on the table) is
rather userful for non-technical people as it is visual and one can easily
set up some queries without actually key in the SQL code.
Somehow I just can't find the features that I need :
(1) save this query so that I can reuse it. (Query Analyzer can do it but
then it is not visual)
(2) to output the result as a file in some path.(Again Query Analyzer can do
it )
Hope someone can share their experience on the above .> The Open Table Query feature on a table (by right clicking on the table)
> is
> rather userful for non-technical people as it is visual and one can easily
> set up some queries without actually key in the SQL code.
IMHO, Enterprise Manager is somewhere between non-technical and technical.
The query designer can help someone with cursory database knowledge retrieve
data but doesn't support some of the more advanced SQL constructs. This is
why many technical users prefer Query Analyzer.
Be aware that SQL Server client tools are not really intended to be used for
end-user ad-hoc reporting. Consider an application like Excel or the Report
Builder feature of SQL 2005 Reporting Services for end-user ad-hoc queries.

> (1) save this query so that I can reuse it. (Query Analyzer can do it but
> then it is not visual)
Copy/paste the generated SQL and save to a file. To reuse that query, paste
the SQL into a query designer SQL pane and click the check SQL syntax button
to refresh the GUI.

> (2) to output the result as a file in some path.(Again Query Analyzer can
> do
> it )
If you don't want to use QA for this task, you can copy the result grid,
paste into Excel and save in the format you prefer.
Hope this helps.
Dan Guzman
SQL Server MVP
"Delf" <Delf@.discussions.microsoft.com> wrote in message
news:72C6A9C1-F843-47C7-A4E6-19F1E8DA7805@.microsoft.com...
> I'm using the Client Tools installation.
> The Open Table Query feature on a table (by right clicking on the table)
> is
> rather userful for non-technical people as it is visual and one can easily
> set up some queries without actually key in the SQL code.
> Somehow I just can't find the features that I need :
> (1) save this query so that I can reuse it. (Query Analyzer can do it but
> then it is not visual)
> (2) to output the result as a file in some path.(Again Query Analyzer can
> do
> it )
> Hope someone can share their experience on the above .
>|||Thanks for the reply. Was expecting it to have a similar save as query and a
way of outputing directly.
One more question :
When right click on either the SQL or Diagram pane after Open Table Query,
there is a "Save As" and "Save" but when I click on them, there is no
response at all. Is that a bug ?
"Dan Guzman" wrote:

> IMHO, Enterprise Manager is somewhere between non-technical and technical.
> The query designer can help someone with cursory database knowledge retrie
ve
> data but doesn't support some of the more advanced SQL constructs. This i
s
> why many technical users prefer Query Analyzer.
> Be aware that SQL Server client tools are not really intended to be used f
or
> end-user ad-hoc reporting. Consider an application like Excel or the Repo
rt
> Builder feature of SQL 2005 Reporting Services for end-user ad-hoc queries
.
>
> Copy/paste the generated SQL and save to a file. To reuse that query, pas
te
> the SQL into a query designer SQL pane and click the check SQL syntax butt
on
> to refresh the GUI.
>
> If you don't want to use QA for this task, you can copy the result grid,
> paste into Excel and save in the format you prefer.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Delf" <Delf@.discussions.microsoft.com> wrote in message
> news:72C6A9C1-F843-47C7-A4E6-19F1E8DA7805@.microsoft.com...
>
>|||> When right click on either the SQL or Diagram pane after Open Table Query,
> there is a "Save As" and "Save" but when I click on them, there is no
> response at all. Is that a bug ?
This is documented behavior. From the SQL 2000 Books Online
<Excerpt
href="vdtsql.chm::/ _visual_database_tools_usage_considerati
ons.htm">
Although Query Designer provides menu options for saving, these options are
disabled.
</Excerpt>
The chapter also mentions the copy/paste method to print/save results and
queries. I believe the Query Designer tool is intended to be used as a
visual method to create SQL queries and not much else.
Hope this helps.
Dan Guzman
SQL Server MVP
"Delf" <Delf@.discussions.microsoft.com> wrote in message
news:C480D47F-F225-40CD-8FD3-E5252A1A97FA@.microsoft.com...[vbcol=seagreen]
> Thanks for the reply. Was expecting it to have a similar save as query and
> a
> way of outputing directly.
> One more question :
> When right click on either the SQL or Diagram pane after Open Table Query,
> there is a "Save As" and "Save" but when I click on them, there is no
> response at all. Is that a bug ?
>
> "Dan Guzman" wrote:
>

Open Table Query's Capabilities

I'm using the Client Tools installation.
The Open Table Query feature on a table (by right clicking on the table) is
rather userful for non-technical people as it is visual and one can easily
set up some queries without actually key in the SQL code.
Somehow I just can't find the features that I need :
(1) save this query so that I can reuse it. (Query Analyzer can do it but
then it is not visual)
(2) to output the result as a file in some path.(Again Query Analyzer can do
it )
Hope someone can share their experience on the above .> The Open Table Query feature on a table (by right clicking on the table)
> is
> rather userful for non-technical people as it is visual and one can easily
> set up some queries without actually key in the SQL code.
IMHO, Enterprise Manager is somewhere between non-technical and technical.
The query designer can help someone with cursory database knowledge retrieve
data but doesn't support some of the more advanced SQL constructs. This is
why many technical users prefer Query Analyzer.
Be aware that SQL Server client tools are not really intended to be used for
end-user ad-hoc reporting. Consider an application like Excel or the Report
Builder feature of SQL 2005 Reporting Services for end-user ad-hoc queries.
> (1) save this query so that I can reuse it. (Query Analyzer can do it but
> then it is not visual)
Copy/paste the generated SQL and save to a file. To reuse that query, paste
the SQL into a query designer SQL pane and click the check SQL syntax button
to refresh the GUI.
> (2) to output the result as a file in some path.(Again Query Analyzer can
> do
> it )
If you don't want to use QA for this task, you can copy the result grid,
paste into Excel and save in the format you prefer.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Delf" <Delf@.discussions.microsoft.com> wrote in message
news:72C6A9C1-F843-47C7-A4E6-19F1E8DA7805@.microsoft.com...
> I'm using the Client Tools installation.
> The Open Table Query feature on a table (by right clicking on the table)
> is
> rather userful for non-technical people as it is visual and one can easily
> set up some queries without actually key in the SQL code.
> Somehow I just can't find the features that I need :
> (1) save this query so that I can reuse it. (Query Analyzer can do it but
> then it is not visual)
> (2) to output the result as a file in some path.(Again Query Analyzer can
> do
> it )
> Hope someone can share their experience on the above .
>|||Thanks for the reply. Was expecting it to have a similar save as query and a
way of outputing directly.
One more question :
When right click on either the SQL or Diagram pane after Open Table Query,
there is a "Save As" and "Save" but when I click on them, there is no
response at all. Is that a bug ?
"Dan Guzman" wrote:
> > The Open Table Query feature on a table (by right clicking on the table)
> > is
> > rather userful for non-technical people as it is visual and one can easily
> > set up some queries without actually key in the SQL code.
> IMHO, Enterprise Manager is somewhere between non-technical and technical.
> The query designer can help someone with cursory database knowledge retrieve
> data but doesn't support some of the more advanced SQL constructs. This is
> why many technical users prefer Query Analyzer.
> Be aware that SQL Server client tools are not really intended to be used for
> end-user ad-hoc reporting. Consider an application like Excel or the Report
> Builder feature of SQL 2005 Reporting Services for end-user ad-hoc queries.
> > (1) save this query so that I can reuse it. (Query Analyzer can do it but
> > then it is not visual)
> Copy/paste the generated SQL and save to a file. To reuse that query, paste
> the SQL into a query designer SQL pane and click the check SQL syntax button
> to refresh the GUI.
> > (2) to output the result as a file in some path.(Again Query Analyzer can
> > do
> > it )
> If you don't want to use QA for this task, you can copy the result grid,
> paste into Excel and save in the format you prefer.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Delf" <Delf@.discussions.microsoft.com> wrote in message
> news:72C6A9C1-F843-47C7-A4E6-19F1E8DA7805@.microsoft.com...
> > I'm using the Client Tools installation.
> > The Open Table Query feature on a table (by right clicking on the table)
> > is
> > rather userful for non-technical people as it is visual and one can easily
> > set up some queries without actually key in the SQL code.
> >
> > Somehow I just can't find the features that I need :
> >
> > (1) save this query so that I can reuse it. (Query Analyzer can do it but
> > then it is not visual)
> >
> > (2) to output the result as a file in some path.(Again Query Analyzer can
> > do
> > it )
> >
> > Hope someone can share their experience on the above .
> >
>
>|||> When right click on either the SQL or Diagram pane after Open Table Query,
> there is a "Save As" and "Save" but when I click on them, there is no
> response at all. Is that a bug ?
This is documented behavior. From the SQL 2000 Books Online
<Excerpt
href="vdtsql.chm::/_visual_database_tools_usage_considerations.htm">
Although Query Designer provides menu options for saving, these options are
disabled.
</Excerpt>
The chapter also mentions the copy/paste method to print/save results and
queries. I believe the Query Designer tool is intended to be used as a
visual method to create SQL queries and not much else.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Delf" <Delf@.discussions.microsoft.com> wrote in message
news:C480D47F-F225-40CD-8FD3-E5252A1A97FA@.microsoft.com...
> Thanks for the reply. Was expecting it to have a similar save as query and
> a
> way of outputing directly.
> One more question :
> When right click on either the SQL or Diagram pane after Open Table Query,
> there is a "Save As" and "Save" but when I click on them, there is no
> response at all. Is that a bug ?
>
> "Dan Guzman" wrote:
>> > The Open Table Query feature on a table (by right clicking on the
>> > table)
>> > is
>> > rather userful for non-technical people as it is visual and one can
>> > easily
>> > set up some queries without actually key in the SQL code.
>> IMHO, Enterprise Manager is somewhere between non-technical and
>> technical.
>> The query designer can help someone with cursory database knowledge
>> retrieve
>> data but doesn't support some of the more advanced SQL constructs. This
>> is
>> why many technical users prefer Query Analyzer.
>> Be aware that SQL Server client tools are not really intended to be used
>> for
>> end-user ad-hoc reporting. Consider an application like Excel or the
>> Report
>> Builder feature of SQL 2005 Reporting Services for end-user ad-hoc
>> queries.
>> > (1) save this query so that I can reuse it. (Query Analyzer can do it
>> > but
>> > then it is not visual)
>> Copy/paste the generated SQL and save to a file. To reuse that query,
>> paste
>> the SQL into a query designer SQL pane and click the check SQL syntax
>> button
>> to refresh the GUI.
>> > (2) to output the result as a file in some path.(Again Query Analyzer
>> > can
>> > do
>> > it )
>> If you don't want to use QA for this task, you can copy the result grid,
>> paste into Excel and save in the format you prefer.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Delf" <Delf@.discussions.microsoft.com> wrote in message
>> news:72C6A9C1-F843-47C7-A4E6-19F1E8DA7805@.microsoft.com...
>> > I'm using the Client Tools installation.
>> > The Open Table Query feature on a table (by right clicking on the
>> > table)
>> > is
>> > rather userful for non-technical people as it is visual and one can
>> > easily
>> > set up some queries without actually key in the SQL code.
>> >
>> > Somehow I just can't find the features that I need :
>> >
>> > (1) save this query so that I can reuse it. (Query Analyzer can do it
>> > but
>> > then it is not visual)
>> >
>> > (2) to output the result as a file in some path.(Again Query Analyzer
>> > can
>> > do
>> > it )
>> >
>> > Hope someone can share their experience on the above .
>> >
>>sql

Monday, March 19, 2012

Open New Window from Iframe

I am having this problem. Any thoughts?
the standard way of opening a new window using the Jump To URL
navigation feature - ie using the
="javascript:void(window.open('someURL'))" works great as long as the
report containing these links is NOT in an IFRAME. If it is, it's
treating the Javascript as the URL.
Anyone getting same results? Anyone know of a workaround?This is one I use. But, this opens it up in a new window.
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
I worked with someone about a week ago who wanted to do what you do. This is
what I believed worked for him. Let's say your iframe is called main. Then
do this:
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','main'))"
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Raz" <Raz@.discussions.microsoft.com> wrote in message
news:184220F9-B42F-42B9-80F1-ED8946C29EB6@.microsoft.com...
>I am having this problem. Any thoughts?
> the standard way of opening a new window using the Jump To URL
> navigation feature - ie using the
> ="javascript:void(window.open('someURL'))" works great as long as the
> report containing these links is NOT in an IFRAME. If it is, it's
> treating the Javascript as the URL.
> Anyone getting same results? Anyone know of a workaround?
>|||Thanks for the Reply Bruce. I have read many of your posts and have already
tried opening a window using your technique. Actually the technique works
fine except for when you are opening a window from an Iframe the address bar
in the new window shows
"javascript:void(window.open('http://www.google.com','_blank'))" instead of
the url "http://www.google.com" of course the result of this is "Page cannot
be displayed"
Any thoughts?
"Bruce L-C [MVP]" wrote:
> This is one I use. But, this opens it up in a new window.
> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> I worked with someone about a week ago who wanted to do what you do. This is
> what I believed worked for him. Let's say your iframe is called main. Then
> do this:
> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> "&rs:Format=CSV&rc:Encoding=ASCII','main'))"
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Raz" <Raz@.discussions.microsoft.com> wrote in message
> news:184220F9-B42F-42B9-80F1-ED8946C29EB6@.microsoft.com...
> >I am having this problem. Any thoughts?
> >
> > the standard way of opening a new window using the Jump To URL
> > navigation feature - ie using the
> > ="javascript:void(window.open('someURL'))" works great as long as the
> > report containing these links is NOT in an IFRAME. If it is, it's
> > treating the Javascript as the URL.
> >
> > Anyone getting same results? Anyone know of a workaround?
> >
>
>|||Just to let everyone know I go this working by including &rc:linktarget=_self
in the url to the report server.
"Raz" wrote:
> Thanks for the Reply Bruce. I have read many of your posts and have already
> tried opening a window using your technique. Actually the technique works
> fine except for when you are opening a window from an Iframe the address bar
> in the new window shows
> "javascript:void(window.open('http://www.google.com','_blank'))" instead of
> the url "http://www.google.com" of course the result of this is "Page cannot
> be displayed"
> Any thoughts?
> "Bruce L-C [MVP]" wrote:
> > This is one I use. But, this opens it up in a new window.
> >
> > ="javascript:void(window.open('" & Globals!ReportServerUrl &
> > "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> > "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> >
> > I worked with someone about a week ago who wanted to do what you do. This is
> > what I believed worked for him. Let's say your iframe is called main. Then
> > do this:
> >
> > ="javascript:void(window.open('" & Globals!ReportServerUrl &
> > "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> > "&rs:Format=CSV&rc:Encoding=ASCII','main'))"
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> >
> > "Raz" <Raz@.discussions.microsoft.com> wrote in message
> > news:184220F9-B42F-42B9-80F1-ED8946C29EB6@.microsoft.com...
> > >I am having this problem. Any thoughts?
> > >
> > > the standard way of opening a new window using the Jump To URL
> > > navigation feature - ie using the
> > > ="javascript:void(window.open('someURL'))" works great as long as the
> > > report containing these links is NOT in an IFRAME. If it is, it's
> > > treating the Javascript as the URL.
> > >
> > > Anyone getting same results? Anyone know of a workaround?
> > >
> >
> >
> >

Monday, February 20, 2012

Online Re-indexing vs Offline Re-indexing

Hi,

The other day we tried online re-indexing feature of SQL 2005 and it’s performing faster than offline re-indexing. Could you please validate if it’s supposed to do be this way? I always thought offline should be faster than online.

Thanks,

Ritesh

Generally offline should be faster than online. Offline doesn't have to handle any changes that might be occurring on the table while the re-indexing is taking place, etc., so there's less work that needs to be done. If it seems the online form is faster than the offline, then perhaps it's a matter of caching or disk speed or some concurrent workload that is making it seem faster. Here's a few things that might make your timings invalid:

First, is the table whose index is being rebuilt of good size so that the difference isn't just a couple of seconds so that we're really just talking about 'noise' in the timing?

Has SQL Server's cache been cleared so that you're not including disk reads in one case and not including them in another?

Are they both going to the same disk(s), or is one benefiting from faster drives?

Are you sure one isn't benefiting from a data file that's already been grown to a sufficient size while the other had to wait for the files to be automatically grown? Or perhaps it's the log file that had to grow during the slower test but not during the faster one?

Was some other query running during the slow test that wasn't running during the faster one? Or some other process that was running on the same machine so that less memory or CPU was available?

Don

|||

Both were ran on same system utilizing the same drives. The index on each tables takes more than an hour hence we can really see the difference. The difference on one of the table is huge from 14 hours in offline to 5 hours in online.

Is there a possibility that if indexes are not fragmented it will take lesser time. We are just running rebuild index on tables currently there's no logic to eliminate certain indexes with less fragmentation.

The online re-indexing was ran after offline re-indexing does the sequence can make the difference?

Thanks,

Ritesh

|||

I'd bet the offline (first) test had to do a lot more work than the online (second) test. It's likely that you are continually having to auto-grow your datafile or log by a small amount at a time so that in the first test it's continually stopping to grow the file. Then the second test just uses that already-grown file and never has to wait like the first test did. Growing a data or log file can have a significant impact. Try growing the file to an appropriate size before you do either re-index operation and don't rely on auto-grow to size your files correctly.

When comparing operations like this you should start from exactly the same starting position. I'd recommend you restore from a backup before each re-index test .. it's very important to compare apples to apples when trying to analyze something like this.


Don

|||

We tried online re-indexing by restoring the same database and still we got the better results as compared to offline indexing. Timings have almost double, is there anything that data engine does internally so that online re-indexing is not a bottleneck on the application.

Thanks,

Ritesh

|||

It seems that to get to the bottom of this we'd have to know a lot more about the table(s), indexes, fragmentation, initial file sizes, concurrent workload, etc., which unfortunately I would likely not be able to dig into as deeply as might be needed.

Offline should generally be faster .. it has exclusive access to the table and indexes so there's less overhead.

I still think there must be something else that's adding extra work for the offline form, like having to grow data or log files where the online rebuild doesn't have to do this work. Can you confirm that you've increased the datafile and logfile sizes before you start the test so that it doesn't have to wait for autogrow?


Don

Online Re-indexing vs Offline Re-indexing

Hi,

The other day we tried online re-indexing feature of SQL 2005 and it’s performing faster than offline re-indexing. Could you please validate if it’s supposed to do be this way? I always thought offline should be faster than online.

Thanks,

Ritesh

Generally offline should be faster than online. Offline doesn't have to handle any changes that might be occurring on the table while the re-indexing is taking place, etc., so there's less work that needs to be done. If it seems the online form is faster than the offline, then perhaps it's a matter of caching or disk speed or some concurrent workload that is making it seem faster. Here's a few things that might make your timings invalid:

First, is the table whose index is being rebuilt of good size so that the difference isn't just a couple of seconds so that we're really just talking about 'noise' in the timing?

Has SQL Server's cache been cleared so that you're not including disk reads in one case and not including them in another?

Are they both going to the same disk(s), or is one benefiting from faster drives?

Are you sure one isn't benefiting from a data file that's already been grown to a sufficient size while the other had to wait for the files to be automatically grown? Or perhaps it's the log file that had to grow during the slower test but not during the faster one?

Was some other query running during the slow test that wasn't running during the faster one? Or some other process that was running on the same machine so that less memory or CPU was available?

Don

|||

Both were ran on same system utilizing the same drives. The index on each tables takes more than an hour hence we can really see the difference. The difference on one of the table is huge from 14 hours in offline to 5 hours in online.

Is there a possibility that if indexes are not fragmented it will take lesser time. We are just running rebuild index on tables currently there's no logic to eliminate certain indexes with less fragmentation.

The online re-indexing was ran after offline re-indexing does the sequence can make the difference?

Thanks,

Ritesh

|||

I'd bet the offline (first) test had to do a lot more work than the online (second) test. It's likely that you are continually having to auto-grow your datafile or log by a small amount at a time so that in the first test it's continually stopping to grow the file. Then the second test just uses that already-grown file and never has to wait like the first test did. Growing a data or log file can have a significant impact. Try growing the file to an appropriate size before you do either re-index operation and don't rely on auto-grow to size your files correctly.

When comparing operations like this you should start from exactly the same starting position. I'd recommend you restore from a backup before each re-index test .. it's very important to compare apples to apples when trying to analyze something like this.


Don

|||

We tried online re-indexing by restoring the same database and still we got the better results as compared to offline indexing. Timings have almost double, is there anything that data engine does internally so that online re-indexing is not a bottleneck on the application.

Thanks,

Ritesh

|||

It seems that to get to the bottom of this we'd have to know a lot more about the table(s), indexes, fragmentation, initial file sizes, concurrent workload, etc., which unfortunately I would likely not be able to dig into as deeply as might be needed.

Offline should generally be faster .. it has exclusive access to the table and indexes so there's less overhead.

I still think there must be something else that's adding extra work for the offline form, like having to grow data or log files where the online rebuild doesn't have to do this work. Can you confirm that you've increased the datafile and logfile sizes before you start the test so that it doesn't have to wait for autogrow?


Don

Online Re-indexing vs Offline Re-indexing

Hi,

The other day we tried online re-indexing feature of SQL 2005 and it’s performing faster than offline re-indexing. Could you please validate if it’s supposed to do be this way? I always thought offline should be faster than online.

Thanks,

Ritesh

Generally offline should be faster than online. Offline doesn't have to handle any changes that might be occurring on the table while the re-indexing is taking place, etc., so there's less work that needs to be done. If it seems the online form is faster than the offline, then perhaps it's a matter of caching or disk speed or some concurrent workload that is making it seem faster. Here's a few things that might make your timings invalid:

First, is the table whose index is being rebuilt of good size so that the difference isn't just a couple of seconds so that we're really just talking about 'noise' in the timing?

Has SQL Server's cache been cleared so that you're not including disk reads in one case and not including them in another?

Are they both going to the same disk(s), or is one benefiting from faster drives?

Are you sure one isn't benefiting from a data file that's already been grown to a sufficient size while the other had to wait for the files to be automatically grown? Or perhaps it's the log file that had to grow during the slower test but not during the faster one?

Was some other query running during the slow test that wasn't running during the faster one? Or some other process that was running on the same machine so that less memory or CPU was available?

Don

|||

Both were ran on same system utilizing the same drives. The index on each tables takes more than an hour hence we can really see the difference. The difference on one of the table is huge from 14 hours in offline to 5 hours in online.

Is there a possibility that if indexes are not fragmented it will take lesser time. We are just running rebuild index on tables currently there's no logic to eliminate certain indexes with less fragmentation.

The online re-indexing was ran after offline re-indexing does the sequence can make the difference?

Thanks,

Ritesh

|||

I'd bet the offline (first) test had to do a lot more work than the online (second) test. It's likely that you are continually having to auto-grow your datafile or log by a small amount at a time so that in the first test it's continually stopping to grow the file. Then the second test just uses that already-grown file and never has to wait like the first test did. Growing a data or log file can have a significant impact. Try growing the file to an appropriate size before you do either re-index operation and don't rely on auto-grow to size your files correctly.

When comparing operations like this you should start from exactly the same starting position. I'd recommend you restore from a backup before each re-index test .. it's very important to compare apples to apples when trying to analyze something like this.


Don

|||

We tried online re-indexing by restoring the same database and still we got the better results as compared to offline indexing. Timings have almost double, is there anything that data engine does internally so that online re-indexing is not a bottleneck on the application.

Thanks,

Ritesh

|||

It seems that to get to the bottom of this we'd have to know a lot more about the table(s), indexes, fragmentation, initial file sizes, concurrent workload, etc., which unfortunately I would likely not be able to dig into as deeply as might be needed.

Offline should generally be faster .. it has exclusive access to the table and indexes so there's less overhead.

I still think there must be something else that's adding extra work for the offline form, like having to grow data or log files where the online rebuild doesn't have to do this work. Can you confirm that you've increased the datafile and logfile sizes before you start the test so that it doesn't have to wait for autogrow?


Don