显示标签为“position”的博文。显示所有博文
显示标签为“position”的博文。显示所有博文

2012年3月19日星期一

FK Position

Does it make any difference where we define the FKs in a table? I mean, do I speed up the query if I define it as the second field or the last one? What about the other fields, the ones that are not FKs, but are used as filters in a query?

Raul:

In general, none of this makes much practical difference to speed of execution. The two things that do matter are (1) do you have indexes on the foreign table in place that correspond to your foreign key and (2) does use of that index with a specific query also require a bookmark lookup for that specific query. If the foreign key has a correspondence to the clustered index of the other table -- and that is often the case -- then no bookmark lookup is necessary. If the foreign key has correspondence to a non-clustered index of the other table but there are fields in the other table that are referenced and are not part of the non-clustered index then a bookmark lookup will be necessary.

If a query references only a short list of records then the non-clustered index will often get used to optimize the query. However, if the query references a very large number of records in the foreign table the optimizer may "decide" that the cost of performing the random reads necessary to support bookmark lookups is too high. In these circumstances the optimizer will often opt to perform a table scan of the foreign table instead of of an index seek.

Bleah. Somebody please say this in a better way.

|||

Column position is virtually meaningless in defining PK's.

Column position is virtually menaingless except:

1. In UNIQUE and PRIMARY key constraints, and all indexes, order of columns has meaning.

2. In relatively rare cases, order of column conditions in a WHERE clause is involved (and only when the criteria is so large as to make it impossible for SQL Server to check all possible uses in a timely manner)

The position of a column in a table has no little if any bearing on performance, as it is just a representation of what is physically implemented in bits and bytes down in the physical table. If it were advantageous to reorganize the data on the page, the data could be reorganized by the storage engine without you knowing. So rest easy, it should make no difference at all.

2012年3月11日星期日

Fixed position of table at bottom of report problem...

I have a table that just contains text at the bottom, but depending on
the query, it might land anywhere. it always needs to be one inch from
the bottom.
Any help is appreciated.
trinttrint wrote:
> I have a table that just contains text at the bottom, but depending on
> the query, it might land anywhere. it always needs to be one inch
> from the bottom.
> Any help is appreciated.
You can set the location for the absolute position of the table relative to
the position of its container!
You know your page-size...so fill the top- and left-coordinates with the
right values
regards
Frank|||Ok,
That works...but I can't get the top to go higher than one inch from
the top
Frank Matthiesen wrote:
> trint wrote:
> > I have a table that just contains text at the bottom, but depending
on
> > the query, it might land anywhere. it always needs to be one inch
> > from the bottom.
> > Any help is appreciated.
> You can set the location for the absolute position of the table
relative to
> the position of its container!
> You know your page-size...so fill the top- and left-coordinates with
the
> right values
> regards
> Frank|||trint wrote:
> Ok,
> That works...but I can't get the top to go higher than one inch from
> the top
You can set the top margin / lower margin in report-settings for the whole
report to 0
regards
Frank|||I have a similar issue with absolute positioning. I have a table and a text
box in a report. The textbox should be at the bottom always. The table can
span any number of pages. In this case, fixing the left and top locations is
not working. Can you please suggest me a solution.

2012年3月9日星期五

Fix the position of graphs while scrolling

I have a report with a graph on top and a table at the bottom.
Sometimes the table becomes large enough to go to the second page.
The problem is - the graph doesn't show up on the second page.
Is there a way to fix the position of the graphs - so that it stays in
one place as we scroll down...
Without - spoiling the export to pdf... ?You could make the graph repeat on the second page or you could increase the
page length to avoid the break. We are considering adding the ability to
"float" headers in the SQL 2005 release.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Harry" <harshwardhan@.mailcity.com> wrote in message
news:e48fb32a.0411081427.2da88d72@.posting.google.com...
>I have a report with a graph on top and a table at the bottom.
> Sometimes the table becomes large enough to go to the second page.
> The problem is - the graph doesn't show up on the second page.
> Is there a way to fix the position of the graphs - so that it stays in
> one place as we scroll down...
> Without - spoiling the export to pdf... ?