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

2012年3月27日星期二

Full Text Search Weighted Question

Hello,

I have the following query:

USE test
SELECT new.[key], new.rank,
test_Class.Manufacturer,
test_Class.Model,
test_Class.Title,
test_Class.Description

FROM test_Class
INNER JOIN
FREETEXTTABLE(test_Class, (Manufacturer, Model, Title, Description), 'Logan') AS new
--CONTAINSTABLE(test_Class, (Manufacturer, Title, Description), 'Logan Magnolia') AS new
--FREETEXTTABLE(test_Class, (Manufacturer, Title, Description), 'Logan') AS new
on test_Classs.Class_ID = new.[key]
ORDER by rank desc

I want to have the search work so that if the word logan is in the Manufacturer Column it has a higher rank than if it apeared twice in the description. Basically I want to weight the colomn instead of specific words in the search, which I know how to do. Any Help would greatly be appricated.

Thanks,
TJBump.... is this even possible to do what I am looking to do, I have looked around a bunch and haven't found anything.....

TJ|||Something like this might do (untested):

SELECT new.[key], row_number() over(order by new.rnk) [rank],
xSell_Classifieds.Manufacturer,
xSell_Classifieds.Model,
xSell_Classifieds.Title,
xSell_Classifieds.Description

FROM xSell_Classifieds
INNER JOIN
(select *,0 rnk
from FREETEXTTABLE(xSell_Classifieds, (Manufacturer), 'Logan')AS f1
union all
select *,1 rnk
from FREETEXTTABLE(xSell_Classifieds, (Model, Title, Description), 'Logan')AS f2) as new on xSell_Classifieds.Classified_ID = new.[key]
ORDER by [rank] desc

2012年3月26日星期一

full text search on doc files

I have a list of word files (.doc) I am trying to us the full text
search in sql server to find key words in these word documents. I have
a Windows XP and sql server installed on my machine. ( no network
server). I cant seem to get the code to work to do a search on these
files. I would really appreciate if someone can send me some code from
start to finsh so I can create the sql tables and then catolog to
search for keywords in the word files.What version of SQL Server are you using? Word documents must be stored in
columns of data type image, and another column must be present to store the
type suffix (".doc" for MS Word files).
When full-text indexing is activated for an image column the name of the
column where the suffix is stored must also be set. How this is actually don
e
depends on the SQL Server version.
SQL 2000:
sp_fulltext_column
@.tabname = '<qualified_table_name>'
,@.colname = '<column_name>'
,@.action = 'add'
,@.type_colname = '<type_column_name>'
SQL 2005:
create fulltext index on <table_name>
(<column_name> TYPE COLUMN <type_column_name>
key index <index_name>
If the index has been created appropriately, then you might also check the
SQL Error Log:
http://milambda.blogspot.com/2005/1...n-or-bybug.html
ML
http://milambda.blogspot.com/|||ML,
How do i create the table first and get the files indexed? How do I
get the files catologued? i am using sql2000 . Do i run the sql you
wrote above after the files have been imported?|||Setting up full-text indexing in SQL 2000 is very well documented in Books
Online:
http://msdn.microsoft.com/library/d... />
d_6g1f.asp
After you've created the table and enabled the database for full-text
search, you need to enable the table, then the column for full-text indexing
.
It really doesn't matter whether you set up FTI before inserting data in the
tables, or after, as long as you propagate change to the catalogue before yo
u
try to use full-text search (new rows will not be found by the engine until
the contents have been indexed).
There are several methods of propagating change to the full-text catalogue:
full propagation, incremental propagation and background propagation (with
change tracking). With background propagation new rows are indexed after
they've been inserted and changed rows are indexed after they've been
updated, but there's a performance impact and writetext/updatetext operation
s
are not detected.
To avoid the downside you could use incremental propagation by creating a
SQL Agent Job that starts incremental propagation as frequently as you need.
Are you having any specific problems? You could also ask these questions in
the dedicated newsgorup: "microsoft.public.sqlserver.fulltext".
ML
http://milambda.blogspot.com/|||ML,
I have looked through the link, still not getting it to work. I guess
i need some code, from start to finish, loading the file from the
c:\... and then running the sql. Anything you may have would be
extremely helpful..thanks|||The link I sent you will help you set up full-text indexing, but the actual
method of inserting MS Word documents into the table depends on your client
application.
If you need to insert blobs through T-SQL, you could use BULK INSERT:
http://msdn.microsoft.com/library/d...br />
4fec.asp
Also make sure you create the format file in accordance to this KB article:
http://support.microsoft.com/defaul...kb;en-us;271344
Information on using format files:
http://msdn.microsoft.com/library/d...>
bcp_9yat.asp
ML
http://milambda.blogspot.com/

2012年3月19日星期一

Full text manual, where are pending changes stored

Created a full text index on table met_db_prcd. This table has an id of 658101385.

CREATE FULLTEXT INDEX ON met_db_prcd(db_prcd_dsc, db_prcd_nm)
KEY INDEX Xmet_db_prcd2 on EMART_MET
WITH CHANGE_TRACKING MANUAL

I can see that I have pending changes by running the following command:

sp_fulltext_pendingchanges 658101385

1. Where are the pending changes stored?

In SQL Server 2005 the changes are stored in an Internal Map Table,unlike SQL Server 2000 which had a table sysfulltextnotify table. The stored procedure sp_fulltext_pendingchanges uses the underlining Map table to get relevent information

HTH

Vishal

|||Do you know what the name of the internal map table?

Full text manual, where are pending changes stored

Created a full text index on table met_db_prcd. This table has an id of 658101385.

CREATE FULLTEXT INDEX ON met_db_prcd(db_prcd_dsc, db_prcd_nm)
KEY INDEX Xmet_db_prcd2 on EMART_MET
WITH CHANGE_TRACKING MANUAL

I can see that I have pending changes by running the following command:

sp_fulltext_pendingchanges 658101385

1. Where are the pending changes stored?

In SQL Server 2005 the changes are stored in an Internal Map Table,unlike SQL Server 2000 which had a table sysfulltextnotify table. The stored procedure sp_fulltext_pendingchanges uses the underlining Map table to get relevent information

HTH

Vishal

|||Do you know what the name of the internal map table?

2012年3月11日星期日

Full text index ranking algorithm in SQL Server 2005

I am using full text index to search on one table. Table can be
simplified as (DiscussionID, Discussions) and DiscussionID is the
primary key.
I use freetexttable instead of containstable here.
For example, I want to search on Discussions field with key word
'exchange server'. Interestingly, the row with "exchange server" exact
match ranks lower, for those with "server" ranks higher.
So, I change to ' "exchange server" ', note, use double quote to look
for exact match. However, this won't return me those discussions having
'server' or 'exchange' keywords.
Anyone knows more how the ranking algorithm works? What is the
difference in searching single word and phrases? I am sure it is not as
simple as the most matched. And is there way to provide different
ranking algorithm or even customized ranking algorithm? I know it
cannot be done in 7.0 or 2000, but not sure in 2005.
Thanks,
Shelly
Basically the density or frequency of the keyword occurring relative to the
other keywords will contribute to a higher rank. So as server occurs more
frequently it gets a higher ranking.
The actual formula is Okapi BM-25.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"shellyshao" <shellyshao@.gmail.com> wrote in message
news:1131671866.196093.296410@.g14g2000cwa.googlegr oups.com...
> I am using full text index to search on one table. Table can be
> simplified as (DiscussionID, Discussions) and DiscussionID is the
> primary key.
> I use freetexttable instead of containstable here.
> For example, I want to search on Discussions field with key word
> 'exchange server'. Interestingly, the row with "exchange server" exact
> match ranks lower, for those with "server" ranks higher.
> So, I change to ' "exchange server" ', note, use double quote to look
> for exact match. However, this won't return me those discussions having
> 'server' or 'exchange' keywords.
> Anyone knows more how the ranking algorithm works? What is the
> difference in searching single word and phrases? I am sure it is not as
> simple as the most matched. And is there way to provide different
> ranking algorithm or even customized ranking algorithm? I know it
> cannot be done in 7.0 or 2000, but not sure in 2005.
> Thanks,
> Shelly
>
|||Shelly,
You may want to review this Dec. 2003 SQL Server 2005 FTS white paper for
info on how the ranking algorithms work:
SQL Server 2005 Full-Text Search: Internals and Enhancements (published
December 2003)
http://msdn.microsoft.com/library/de...05ftsearch.asp
Ranking of CONTAINSTABLE
StatisticalWeight = Log2( ( 2 + IndexDocumentCount ) / KeyDocumentCount )
Rank = min( MaxQueryRank, HitCount * 16 * StatisticalWeight /
MaxOccurrence )
Ranking of FREETEXT [or FREETEXTTABLE]
Freetext ranking is based on the OKAPI BM25 ranking formula. Each term in
the query is ranked, and the values are summed. Freetext queries will add
words to the query via inflectional generation (stemmed forms of the
original query terms); these words are treated as separate terms with no
special weighting or relationship with the words from which they were
generated. Synonyms generated from the Thesaurus feature are treated as
separate, equally weighted terms.
Regards,
John
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"shellyshao" <shellyshao@.gmail.com> wrote in message
news:1131671866.196093.296410@.g14g2000cwa.googlegr oups.com...
>I am using full text index to search on one table. Table can be
> simplified as (DiscussionID, Discussions) and DiscussionID is the
> primary key.
> I use freetexttable instead of containstable here.
> For example, I want to search on Discussions field with key word
> 'exchange server'. Interestingly, the row with "exchange server" exact
> match ranks lower, for those with "server" ranks higher.
> So, I change to ' "exchange server" ', note, use double quote to look
> for exact match. However, this won't return me those discussions having
> 'server' or 'exchange' keywords.
> Anyone knows more how the ranking algorithm works? What is the
> difference in searching single word and phrases? I am sure it is not as
> simple as the most matched. And is there way to provide different
> ranking algorithm or even customized ranking algorithm? I know it
> cannot be done in 7.0 or 2000, but not sure in 2005.
> Thanks,
> Shelly
>

2012年3月9日星期五

Full text generating speed decreases continiously

Hi all.

I have an keyword table by 2000000 rows that is an int(4) key and a
varchar(50)
Keyword(Unique index) in Sql Server 2000.

After about 80 seconds of starting full population, speed of adding
new items t in Enterprise manager/Fulltext ctalog, decreases to (1/4)
and more less.

please help me!

Thanks"Naser_geraminia" <nsrgeraminia@.hotmail.com> wrote in message
news:a954aa7.0309111841.1346380a@.posting.google.co m...
> Hi all.
> I have an keyword table by 2000000 rows that is an int(4) key and a
> varchar(50)
> Keyword(Unique index) in Sql Server 2000.
> After about 80 seconds of starting full population, speed of adding
> new items t in Enterprise manager/Fulltext ctalog, decreases to (1/4)
> and more less.
> please help me!
> Thanks

You might want to post this in microsoft.public.sqlserver.fulltext as well -
you may get a better response there.

Simon

Full Text Compatible index

I want to put a full text search on a table. using SQL Server Management
Studio 20005.
The table has a clustered Key Like this:
Thing,Version,Field1,Field2 and so on.
The Key is Thing and Version.
I can create a index on these columns but it will not show up in the Full
Text Index utility (Full Text Index)(Define Full Text Index) Selection from
the table right click menu.
I have also tried no Clustered Key and just a index of the two fields which
does not work.
I might mention that other tables with only one column for the key work for
Full Text search.
Thank you
Jerry
Hi Jerry,
From your description, I understand that the indexed columns were not
displayed in the Full Text Index wizard in SSMS. The table had a clustered
key index with two columns. This issue did not occur if there is only one
Key column.
If I have misunderstood, please let me know.
This is expected by design. Essentially the problem was caused by KEY INDEX
constraints.
You may refer to:
CREATE FULLTEXT INDEX (Transact-SQL)
http://technet.microsoft.com/en-us/library/ms187317.aspx
From the article, we can see the following description regarding KEY INDEX:
<ref>
KEY INDEX index_name
Is the name of the unique key index on table_name. The KEY INDEX must be a
unique, single-key, non-nullable column. Select the smallest unique key
index for the full-text unique key. For best performance, a CLUSTERED index
is recommended.
</ref>
As you can see that the KEY INDEX can only be a single-key. Compound keys
are not allowed. To work around this issue, I recommend that you create a
single column with unique index so that the full-text index can be
correlated to rows in the table.
Hope this helps. If you have any other questions or concerns, please feel
free to let me know. It is my pleasure to be of assistance.
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||Charles,
Thanks. I will use a identity column for the Index
Jerry
"Charles Wang[MSFT]" wrote:

> Hi Jerry,
> From your description, I understand that the indexed columns were not
> displayed in the Full Text Index wizard in SSMS. The table had a clustered
> key index with two columns. This issue did not occur if there is only one
> Key column.
> If I have misunderstood, please let me know.
> This is expected by design. Essentially the problem was caused by KEY INDEX
> constraints.
> You may refer to:
> CREATE FULLTEXT INDEX (Transact-SQL)
> http://technet.microsoft.com/en-us/library/ms187317.aspx
> From the article, we can see the following description regarding KEY INDEX:
> <ref>
> KEY INDEX index_name
> Is the name of the unique key index on table_name. The KEY INDEX must be a
> unique, single-key, non-nullable column. Select the smallest unique key
> index for the full-text unique key. For best performance, a CLUSTERED index
> is recommended.
> </ref>
> As you can see that the KEY INDEX can only be a single-key. Compound keys
> are not allowed. To work around this issue, I recommend that you create a
> single column with unique index so that the full-text index can be
> correlated to rows in the table.
> Hope this helps. If you have any other questions or concerns, please feel
> free to let me know. It is my pleasure to be of assistance.
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> ================================================== ===
> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ================================================== ====
> This posting is provided "AS IS" with no warranties, and confers no rights.
> ================================================== ====
>
>

Full Text Compatible index

I want to put a full text search on a table. using SQL Server Management
Studio 20005.
The table has a clustered Key Like this:
Thing,Version,Field1,Field2 and so on.
The Key is Thing and Version.
I can create a index on these columns but it will not show up in the Full
Text Index utility (Full Text Index)(Define Full Text Index) Selection from
the table right click menu.
I have also tried no Clustered Key and just a index of the two fields which
does not work.
I might mention that other tables with only one column for the key work for
Full Text search.
Thank you
--
JerryHi Jerry,
From your description, I understand that the indexed columns were not
displayed in the Full Text Index wizard in SSMS. The table had a clustered
key index with two columns. This issue did not occur if there is only one
Key column.
If I have misunderstood, please let me know.
This is expected by design. Essentially the problem was caused by KEY INDEX
constraints.
You may refer to:
CREATE FULLTEXT INDEX (Transact-SQL)
http://technet.microsoft.com/en-us/library/ms187317.aspx
From the article, we can see the following description regarding KEY INDEX:
<ref>
KEY INDEX index_name
Is the name of the unique key index on table_name. The KEY INDEX must be a
unique, single-key, non-nullable column. Select the smallest unique key
index for the full-text unique key. For best performance, a CLUSTERED index
is recommended.
</ref>
As you can see that the KEY INDEX can only be a single-key. Compound keys
are not allowed. To work around this issue, I recommend that you create a
single column with unique index so that the full-text index can be
correlated to rows in the table.
Hope this helps. If you have any other questions or concerns, please feel
free to let me know. It is my pleasure to be of assistance.
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||Charles,
Thanks. I will use a identity column for the Index
--
Jerry
"Charles Wang[MSFT]" wrote:
> Hi Jerry,
> From your description, I understand that the indexed columns were not
> displayed in the Full Text Index wizard in SSMS. The table had a clustered
> key index with two columns. This issue did not occur if there is only one
> Key column.
> If I have misunderstood, please let me know.
> This is expected by design. Essentially the problem was caused by KEY INDEX
> constraints.
> You may refer to:
> CREATE FULLTEXT INDEX (Transact-SQL)
> http://technet.microsoft.com/en-us/library/ms187317.aspx
> From the article, we can see the following description regarding KEY INDEX:
> <ref>
> KEY INDEX index_name
> Is the name of the unique key index on table_name. The KEY INDEX must be a
> unique, single-key, non-nullable column. Select the smallest unique key
> index for the full-text unique key. For best performance, a CLUSTERED index
> is recommended.
> </ref>
> As you can see that the KEY INDEX can only be a single-key. Compound keys
> are not allowed. To work around this issue, I recommend that you create a
> single column with unique index so that the full-text index can be
> correlated to rows in the table.
> Hope this helps. If you have any other questions or concerns, please feel
> free to let me know. It is my pleasure to be of assistance.
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> =====================================================> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ======================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
> ======================================================>
>|||Hi Jerry,
Appreciate your update and response. I am glad to hear that the suggestions
are helpful. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.
Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================

Full Text Compatible index

I want to put a full text search on a table. using SQL Server Management
Studio 20005.
The table has a clustered Key Like this:
Thing,Version,Field1,Field2 and so on.
The Key is Thing and Version.
I can create a index on these columns but it will not show up in the Full
Text Index utility (Full Text Index)(Define Full Text Index) Selection from
the table right click menu.
I have also tried no Clustered Key and just a index of the two fields which
does not work.
I might mention that other tables with only one column for the key work for
Full Text search.
Thank you
JerryHi Jerry,
From your description, I understand that the indexed columns were not
displayed in the Full Text Index wizard in SSMS. The table had a clustered
key index with two columns. This issue did not occur if there is only one
Key column.
If I have misunderstood, please let me know.
This is expected by design. Essentially the problem was caused by KEY INDEX
constraints.
You may refer to:
CREATE FULLTEXT INDEX (Transact-SQL)
http://technet.microsoft.com/en-us/...y/ms187317.aspx
From the article, we can see the following description regarding KEY INDEX:
<ref>
KEY INDEX index_name
Is the name of the unique key index on table_name. The KEY INDEX must be a
unique, single-key, non-nullable column. Select the smallest unique key
index for the full-text unique key. For best performance, a CLUSTERED index
is recommended.
</ref>
As you can see that the KEY INDEX can only be a single-key. Compound keys
are not allowed. To work around this issue, I recommend that you create a
single column with unique index so that the full-text index can be
correlated to rows in the table.
Hope this helps. If you have any other questions or concerns, please feel
free to let me know. It is my pleasure to be of assistance.
Best regards,
Charles Wang
Microsoft Online Community Support
========================================
=============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============|||Charles,
Thanks. I will use a identity column for the Index
--
Jerry
"Charles Wang[MSFT]" wrote:

> Hi Jerry,
> From your description, I understand that the indexed columns were not
> displayed in the Full Text Index wizard in SSMS. The table had a clustered
> key index with two columns. This issue did not occur if there is only one
> Key column.
> If I have misunderstood, please let me know.
> This is expected by design. Essentially the problem was caused by KEY INDE
X
> constraints.
> You may refer to:
> CREATE FULLTEXT INDEX (Transact-SQL)
> http://technet.microsoft.com/en-us/...y/ms187317.aspx
> From the article, we can see the following description regarding KEY INDEX
:
> <ref>
> KEY INDEX index_name
> Is the name of the unique key index on table_name. The KEY INDEX must be a
> unique, single-key, non-nullable column. Select the smallest unique key
> index for the full-text unique key. For best performance, a CLUSTERED inde
x
> is recommended.
> </ref>
> As you can see that the KEY INDEX can only be a single-key. Compound keys
> are not allowed. To work around this issue, I recommend that you create a
> single column with unique index so that the full-text index can be
> correlated to rows in the table.
> Hope this helps. If you have any other questions or concerns, please feel
> free to let me know. It is my pleasure to be of assistance.
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> ========================================
=============
> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ========================================
==============
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> ========================================
==============
>
>

2012年2月19日星期日

FTS query performance on SQL 2005

I am seeing some query performance issues on a full-text search on SQL 2005.
My table has about 20 million rows, containing an integer primary key and a
field of type text. This is running on a dual core Xeon 2.8 Ghz processor, 2
GB RAM, 15k RPM drives in a RAID 5 configuration.
My query looks like this:
select ItemID FROM Item WHERE CONTAINS(ItemText, 'there')
which returns about 40,000 rows, but the query takes over 2 minutes! Is that
normal performance for this beefy server for such a simple query? If I add
"TOP 20" after the SELECT, the query takes under 1 second.
I have checked the hardware and I can't seem to find constraints, either in
CPU, memory or disk. Any ideas why that query takes over 2 minutes?
Thanks.
Speed depends on the complexity of your query and the amount of rows you are
returning. In your case you have a simple query and what appears to be
causing the performance problem. I would use containstable with the
top_n_by_rank parameter to limit your results set to 100 or 200 rows.
Is this SQL 2005? There are some optimizations for SQL 2005 which will offer
better performance.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Bahama Joe" <someone@.microsoft.com> wrote in message
news:ub9L57y%23GHA.1224@.TK2MSFTNGP05.phx.gbl...
>I am seeing some query performance issues on a full-text search on SQL
>2005. My table has about 20 million rows, containing an integer primary key
>and a field of type text. This is running on a dual core Xeon 2.8 Ghz
>processor, 2 GB RAM, 15k RPM drives in a RAID 5 configuration.
> My query looks like this:
> select ItemID FROM Item WHERE CONTAINS(ItemText, 'there')
> which returns about 40,000 rows, but the query takes over 2 minutes! Is
> that normal performance for this beefy server for such a simple query? If
> I add "TOP 20" after the SELECT, the query takes under 1 second.
> I have checked the hardware and I can't seem to find constraints, either
> in CPU, memory or disk. Any ideas why that query takes over 2 minutes?
> Thanks.
>
|||Thanks for the reply. Yes, this is SQL 2005 - what optimizations are you
referring to? I believe I have applied all optimizations that I've been able
to find in the various posts and online docs.
I know that I can limit the size of the resultset with top_n_by_rank, but in
this case, I'm trying to get back the full set of results. Another form of
my query is to do a "select count(*)", which has the same response times. I
believe this is because the full resultset is returned from the FTE back to
SQL Server, and then the count is taken on that. Is there a way to structure
the query to tell the FTE that you just want the count of results, so that
it doesn't ship the full results back to SQL Server?
Essentially, I'm trying to create a search engine, where the results will be
displayed back to the user in paginated form, so it will always display a
subset of the resultset, but I'd like to also display "Showing results 1-20
of 40,000", so I need a way to get the size of the resultset.
With regard to hardware, would you expect that I will get the most bang for
my buck by a) spreading my data across more disks (via RAID) in a single
server, b) creating a cluster of separate servers, c) adding more memory, or
d) adding more CPU's?
Thanks.
|||Thanks for the reply. Yes, this is SQL 2005 - what optimizations are you
referring to? I believe I have applied all optimizations that I've been able
to find in the various posts and online docs.
I know that I can limit the size of the resultset with top_n_by_rank, but in
this case, I'm trying to get back the full set of results. Another form of
my query is to do a "select count(*)", which has the same response times. I
believe this is because the full resultset is returned from the FTE back to
SQL Server, and then the count is taken on that. Is there a way to structure
the query to tell the FTE that you just want the count of results, so that
it doesn't ship the full results back to SQL Server?
Essentially, I'm trying to create a search engine, where the results will be
displayed back to the user in paginated form, so it will always display a
subset of the resultset, but I'd like to also display "Showing results 1-20
of 40,000", so I need a way to get the size of the resultset.
With regard to hardware, would you expect that I will get the most bang for
my buck by a) spreading my data across more disks (via RAID) in a single
server, b) creating a cluster of separate servers, c) adding more memory, or
d) adding more CPU's?
Thanks.
|||I'm struggling with the same issues as you.
Basically what i do is bank on the fact that it is rare for most people to
look beyond the first page of results, so I write the results of the search
to a table, and return it to a data reader displaying the first 25 results
and a count of all search results. Repeat searches go against the cached
table.
The optimizations are
1) use 64 bit
2) use a high resource_usage keeping in mind this can cause locking
3) reorganize your catalogs frequently
4) set ft crawl bandwidth (max) and ft notify bandwidth (max) to 0
5) max full-text crawl range to the number of cpu's on your system
6) convert your binary data to text
and you get the best bank for your buck by placing the full-text catalog on
its own disk subsystem and controller with the fastest disks available. RAID
5 offers best read performance, but for frequently updated catalogs use raid
10.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Bahama Joe" <someone@.microsoft.com> wrote in message
news:epadrr9%23GHA.4712@.TK2MSFTNGP03.phx.gbl...
> Thanks for the reply. Yes, this is SQL 2005 - what optimizations are you
> referring to? I believe I have applied all optimizations that I've been
> able
> to find in the various posts and online docs.
> I know that I can limit the size of the resultset with top_n_by_rank, but
> in
> this case, I'm trying to get back the full set of results. Another form of
> my query is to do a "select count(*)", which has the same response times.
> I
> believe this is because the full resultset is returned from the FTE back
> to
> SQL Server, and then the count is taken on that. Is there a way to
> structure
> the query to tell the FTE that you just want the count of results, so that
> it doesn't ship the full results back to SQL Server?
> Essentially, I'm trying to create a search engine, where the results will
> be
> displayed back to the user in paginated form, so it will always display a
> subset of the resultset, but I'd like to also display "Showing results
> 1-20
> of 40,000", so I need a way to get the size of the resultset.
> With regard to hardware, would you expect that I will get the most bang
> for
> my buck by a) spreading my data across more disks (via RAID) in a single
> server, b) creating a cluster of separate servers, c) adding more memory,
> or
> d) adding more CPU's?
> Thanks.
>
>
|||Thanks for the reply. I had already applied optimizations 2, 4 and 5, based
on one of your earlier posts in another thread. I don't have access to a
64-bit server, but this is a good suggestion. My data is static data, so I
don't expect I'll need to reorganize the catalogs frequently. Also, I only
have text data stored in a single column of type 'text', no binary data.
With regard to caching, I find that subsequent queries using the same search
string (i.e. to support the user going to the next page) come back in about
3-4 ms, meaning that there's already some good caching in place within SQL
Server. It seems that relying on that should be sufficient, instead of
creating my own sepearate caching mechanism as you describe. Is that not
your experience? The most pressing issue I'm trying to resolve is why the
first query (without a top_n_by_rank) can sometimes take 2-3 minutes to
respond.
Thanks.
|||This could be caching of the catalog pages. What is your max server memory
setting?
sp_configure 'max server memory (MB)'
Also what happens if you just issue a new contains query ie like this
select * from TableName where contains(*,'"George Bush"')
supposing you have not searched for George Bush recently and he is in your
content?
It could be that the other tables are causing the performance hit and not
your full-text queries themselves.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Bahama Joe" <someone@.microsoft.com> wrote in message
news:ON3tvnE$GHA.5092@.TK2MSFTNGP04.phx.gbl...
> Thanks for the reply. I had already applied optimizations 2, 4 and 5,
> based on one of your earlier posts in another thread. I don't have access
> to a 64-bit server, but this is a good suggestion. My data is static data,
> so I don't expect I'll need to reorganize the catalogs frequently. Also, I
> only have text data stored in a single column of type 'text', no binary
> data.
> With regard to caching, I find that subsequent queries using the same
> search string (i.e. to support the user going to the next page) come back
> in about 3-4 ms, meaning that there's already some good caching in place
> within SQL Server. It seems that relying on that should be sufficient,
> instead of creating my own sepearate caching mechanism as you describe. Is
> that not your experience? The most pressing issue I'm trying to resolve is
> why the first query (without a top_n_by_rank) can sometimes take 2-3
> minutes to respond.
> Thanks.
>
|||Hello Bahama,
Is this an upgrade or a new SQL install?
Make sure you update your statistics and possibly rebuild your indexes.
To get a count it is better to do select count(1) from containstable (table,
column,search)
To get the paged results do SELECT TOP x where x covers the page the users
wants.
Make sure you SQL box isn't using all the memory, you need to share it with
full text.
How big is your database? 20 million rows and 2Gb of cache doesn't allow
for much of you DB to be cached.
What indexes do you have on your tables?
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> Thanks for the reply. I had already applied optimizations 2, 4 and 5,
> based on one of your earlier posts in another thread. I don't have
> access to a 64-bit server, but this is a good suggestion. My data is
> static data, so I don't expect I'll need to reorganize the catalogs
> frequently. Also, I only have text data stored in a single column of
> type 'text', no binary data.
> With regard to caching, I find that subsequent queries using the same
> search string (i.e. to support the user going to the next page) come
> back in about 3-4 ms, meaning that there's already some good caching
> in place within SQL Server. It seems that relying on that should be
> sufficient, instead of creating my own sepearate caching mechanism as
> you describe. Is that not your experience? The most pressing issue I'm
> trying to resolve is why the first query (without a top_n_by_rank) can
> sometimes take 2-3 minutes to respond.
> Thanks.
>
|||Hilary,
Here is the result of that query:
name=max server memory (MB)
minimum=16
maximum=2147483647
config_value=4096
run_value=4096
Is that configured correctly for a server w/ 2GB of physical RAM?
Also, in one of your earlier posts, you mentioned setting "max full-text
crawl range" to the number of CPU's on the system. I have a dual-core Xeon
processor, meaning it has 2 CPU's (in one chip). However, due to Hyper
Threading, Windows and SQL Server see this server as having 4 CPU's, so I
have that value set to 4. Is that a good setting?
All of my tests have been on just the single table that contains my
full-text index, such as "select ItemID from Item where
contains(ItemText,'"George Bush"')", so there are no other tables involved.
Thanks for all of your insightful replies.
|||Hello Simon,
This is a new SQL install. I just created the table, loaded it with all 20
million rows from a text file via "Import data...", then created the
full-text index (which took about 2 hours). My table basically includes an
"int" primary key (clustered index) column and a "text" column with the text
to be indexed. The table also includes 2 other "text" fields, but they're
not involved in these queries. The result is a database .MDF file of approx.
12GB and a full-text index with files of approx. 2GB, with the full-text
index containing approx. 1.4 million unique keys.
When I look at task manager for memory usage, I see the following:
sqlservr.exe --> mem usage=740MB, VM size=749MB
msftesql.exe --> mem usage=7.6MB, VM size=5MB
Right after a reboot, these numbers are continually rising, but after a
number of queries, these numbers steady out to the ones listed above. Based
on this, would you recommend that I change my memory configuration?
Thanks.