
Şekil 2

Sp içerik .
USE [ARSIVMPDB]
-- =============================================
-- Author: Eralp Erat
-- =============================================
ALTER PROCEDURE [dbo].[GetMostUsedKeywordsWithSuffixWithRatio]
@key as nvarchar(100),
@ratio as decimal(18,2)= 0.80
AS
BEGIN
SET NOCOUNT ON;
DECLARE @SearchWord varchar(100)
SET @SearchWord = @key
DECLARE @SearchWord2 varchar(100)
SET @SearchWord2 = '"'+@key+'"';
CREATE TABLE [dbo].[#tbl_News_q](
[KELIME] nvarchar(60),
[DEGER] [decimal](18, 2) NULL
)
DECLARE @DEGER decimal(18,2)
DECLARE @DEGERLIMIT decimal(18,2)
DECLARE @TOPLAM decimal(18,2)
DECLARE @KELIME nvarchar(60)
SET @TOPLAM = 0;
SET @DEGERLIMIT = 0;
SET @DEGER = 0;
select @DEGERLIMIT = (
select sum(y.adet)
from (Select sep.Col as A,COUNT(*) as adet FROM (
Select * FROM (
Select value =
Upper(RTrim(LTrim(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
CAST(content as nvarchar(MAX)),
',', ' '), '.', ' '),
'!', ' '), '+', ' '),
':', ' '), '-', ' '),
';', ' '), '(', ' '),
')', ' '), '/', ' '),
'&', ''), '?', ' '),
' ', ' '), ' ', ' '))))
FROM tbl_News as t where CONTAINS(t.Content,@SearchWord2)
) easyValues
Where value <> ''
) actualValues
Cross Apply dbo.SeparateValues(value, ' ') sep
Group By sep.Col
) as y
where y.A like ''+@SearchWord+'%'
--Order By y.adet Desc
) * @ratio
SET @TOPLAM = 0;
SET @DEGER = 0;
DECLARE Toplam_Cursor CURSOR FOR
select y.A as KELIME,y.adet as DEGER
from (Select sep.Col as A,COUNT(*) as adet FROM (
Select * FROM (
Select value =
Upper(RTrim(LTrim(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
Replace(Replace(
CAST(content as nvarchar(MAX)),
',', ' '), '.', ' '),
'!', ' '), '+', ' '),
':', ' '), '-', ' '),
';', ' '), '(', ' '),
')', ' '), '/', ' '),
'&', ''), '?', ' '),
' ', ' '), ' ', ' '))))
FROM tbl_News as t where CONTAINS(t.Content,@SearchWord2)
) easyValues
Where value <> ''
) actualValues
Cross Apply dbo.SeparateValues(value, ' ') sep
Group By sep.Col
) as y
where y.A like ''+@SearchWord+'%'
Order By y.adet Desc
OPEN Toplam_Cursor
FETCH NEXT FROM Toplam_Cursor INTO @KELIME,@DEGER
WHILE @@FETCH_STATUS =0
BEGIN
SET @TOPLAM = @TOPLAM + @DEGER
if (@TOPLAM < @DEGERLIMIT)
begin
insert into #tbl_News_q(KELIME,DEGER) values (@KELIME,@DEGER)
FETCH NEXT FROM Toplam_Cursor INTO @KELIME,@DEGER
end else
break;
END
CLOSE Toplam_Cursor
DEALLOCATE Toplam_Cursor
select * from #tbl_News_q
END
--
You received this message because you are subscribed to the Google Groups "altdotnetturkiye" group.
To post to this group, send email to altdotne...@googlegroups.com.
To unsubscribe from this group, send email to altdotnetturki...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/altdotnetturkiye?hl=en.
Execution Plan'i eke koydum.
23 Mayıs 2012 16:25 tarihinde Eralp Erat <eralp...@gmail.com> yazdı:
Selamlar ;aşağıda gorduğunuz üzere bir tablo var ve tabloda 2.3 milyon kayıt var.bu tabloada yer alan content alanını kullanarak bir sorgu oluşturdum.sorgunun amacı su , girilen keyword e bağlı olarak (bundan sonra keyword olarak anılacak) content alanında arama yapıyor ve girilen keyword+... şeklinde bütün kelimeleri (ve grupları) dökmesi.Ek olarak gelen sonucların % N 'lik bir kısmına dail olması ( örneğin %90 a giriyorsa sonuclarda görünsün.) durumuda var.yani SABANCI diye birşey girdiğimde bana gelen şekil 2 deki gibi çıktı.Sorgu çok yavaş çalışıyor..Derdim bunu hızlandırmak!..SP'nin çıktısını aşağıda verdim.
Fikirlerinizi alabilir miyim ?Tşk.
şekil -1<image.png>
Şekil 2
<image.png>
<era.sqlplan>
DECLARE @total as int;
select @total = 0;
DECLARE @ratio as decimal (18,2);
set @ratio = 0.90;
DECLARE @SearchWord varchar(100)
SET @SearchWord = 'SABANCI'
DECLARE @SearchWord2 varchar(100)
SET @SearchWord2 = '"'+@SearchWord+'"';
--drop table [#tbl_News_q]
CREATE TABLE [dbo].[#tbl_News_q](
[KELIME] nvarchar(60),
[DEGER] [decimal](18, 2) NULL
)
DECLARE @DEGER decimal(18,2)
DECLARE @DEGERLIMIT decimal(18,2)
DECLARE @TOPLAM decimal(18,2)
DECLARE @KELIME nvarchar(60)
SET @TOPLAM = 0;
SET @DEGERLIMIT = 0;
SET @DEGER = 0;
--select @DEGERLIMIT = (
-- select sum(y.adet)
-- from (Select sep.Col as A,COUNT(*) as adet FROM (
-- Select * FROM (
-- Select value =
-- Upper(RTrim(LTrim(
-- Replace(Replace(
-- Replace(Replace(
-- Replace(Replace(
-- Replace(Replace(
-- Replace(Replace(
-- Replace(Replace(
-- Replace(Replace(
-- CAST(content as nvarchar(MAX)),
-- ',', ' '), '.', ' '),
-- '!', ' '), '+', ' '),
-- ':', ' '), '-', ' '),
-- ';', ' '), '(', ' '),
-- ')', ' '), '/', ' '),
-- '&', ''), '?', ' '),
-- ' ', ' '), ' ', ' '))))
-- FROM tbl_News as t where CONTAINS(t.Content,@SearchWord2)
-- ) easyValues
-- Where value <> ''
-- ) actualValues
-- Cross Apply dbo.SeparateValues(value, ' ') sep
-- Group By sep.Col
-- ) as y
-- where y.A like ''+@SearchWord+'%'
-- --Order By y.adet Desc
--) * @ratio
END
CLOSE Toplam_Cursor
SET @KELIME = null;
SET @DEGER = 0;
SET @DEGERLIMIT = @TOPLAM * @ratio;
SET @TOPLAM = 0;
OPEN Toplam_Cursor
FETCH NEXT FROM Toplam_Cursor INTO @KELIME,@DEGER
WHILE @@FETCH_STATUS =0
BEGIN
SET @TOPLAM = @TOPLAM + @DEGER
if (@TOPLAM < @DEGERLIMIT)
begin
insert into #tbl_News_q(KELIME,DEGER) values (@KELIME,@DEGER)
FETCH NEXT FROM Toplam_Cursor INTO @KELIME,@DEGER
end else
break;
END
CLOSE Toplam_Cursor
DEALLOCATE Toplam_Cursor
select * from #tbl_News_q
dıııt yanlış cevap, resimleri görüyorum ama, saat 17:00'yi geçtiği için anlamakta zorluk çekiyorum belki de :) "grupları" ve "%N'lik kısmına giriyorsa" kısmını anlamadım. zaten anlasam da yazabilir miyim, orası ayrı konu :)
--
Choosing a charting component for any organization is a complex task because the selection will have to be made considering both the present and future needs of the organization. It requires a careful evaluation of requirements like:
In this section, we have compared FusionCharts Suite with some of the popular charting components that our users typically evaluate along with our product offerings. We also have a whitepaper on "How to choose a charting component for your Web & Enterprise applications?" leads you through a systematic evaluation process of charting components.