473,614 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Quale tipo di indice sulla tabella? Wich kind of index on table..??

STB
ciao a tutti...
ci risono...
devo migliorare delle performance di accesso ad una tabella...
la tabella non ha indice primario, ne altri indici...
sulla tabella ci accedo con select di questo tipo..

select @ExistInOAG = count(*)
FROM caprs05dev.dbo. OAG
WHERE Air_Carrier = @Aircarrier and
cast(ltrim(rtri m(Flt_nbr)) as int) =
cast(ltrim(rtri m(@ComFltNbr)) as int) and
Aipt_Dpt = @AIPTDep and
Aipt_Des = @AIPTDst and
DT_FLIGHT = @Date_Rif and
convert(varchar , STD, 102) = convert(varchar , @STD,
102) and
convert(varchar , STA, 102) = convert(varchar , @STA,
102)

ho provato a creare diversi tipi di indici, ma le performance migliori
le ottengo se lascio stare tutto come era senza nessun'indice!! !! vi
sembra possibile???
le prove che ho fatto sono queste...

inserire un indice tipo Primary con i campi
Flt_nbr,Aipt_Dp t,Aipt_Des,STD, STA
create Unique, tipo Index, con Ignore duplicate key...
create as clustered checcato e fill factor 100%... ci accedo
praticamente solo in select nel file...

avete consigli per migliorare le performance di accesso alla
tabella????

grazie.. stefano!!!
Jul 20 '05 #1
2 2882
STB (s.******@tin.i t) writes:
devo migliorare delle performance di accesso ad una tabella...
la tabella non ha indice primario, ne altri indici...
sulla tabella ci accedo con select di questo tipo..

select @ExistInOAG = count(*)
FROM caprs05dev.dbo. OAG
WHERE Air_Carrier = @Aircarrier and
cast(ltrim(rtri m(Flt_nbr)) as int) =
cast(ltrim(rtri m(@ComFltNbr)) as int) and
Aipt_Dpt = @AIPTDep and
Aipt_Des = @AIPTDst and
DT_FLIGHT = @Date_Rif and
convert(varchar , STD, 102) = convert(varchar , @STD,
102) and
convert(varchar , STA, 102) = convert(varchar , @STA,
102)

ho provato a creare diversi tipi di indici, ma le performance migliori
le ottengo se lascio stare tutto come era senza nessun'indice!! !! vi
sembra possibile???
le prove che ho fatto sono queste...

inserire un indice tipo Primary con i campi
Flt_nbr,Aipt_Dp t,Aipt_Des,STD, STA
create Unique, tipo Index, con Ignore duplicate key...
create as clustered checcato e fill factor 100%... ci accedo
praticamente solo in select nel file...


Un indicie con Flt_nbr come il primo campo non è molto bene, ecco
perchè:

cast(ltrim(rtri m(Flt_nbr)) as int)

Come Flt_nbr si apparire in un'espressione, SQL Server non può usare
l'indice. Questo è una regola basico del indice in SQL Server.

Non so esato la definizione di questa tabella, e non so la distribuzione
di data. Ma solamente i campi Air_Carrier, Aipt_Dpt, Aipt_Des e DT_FLIGHT
sono buoni per un indice nel questo SELECT. Forse un indici clustered
con (Air_Carrir, Aipt_Dpt) e un buon alternativo.
--
Erland Sommarskog, SQL Server MVP, so****@algonet. se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
STB
Grazie mille per la risposta chiarissima e soprattutto per il
consiglio preziosissimo di non mettere mai indici sui campi dove
vengono utilizzate funzioni!!!!

grazie mille davvero!!!!

Rellay many thanks to you for the answer!!!!
you tip "not insert index on field who had function over" is really
precious.. really gold tips...

really many tanks.. now the batch end in 1min30sec... before
1h22min!!!

Erland Sommarskog <so****@algonet .se> wrote in message news:<Xn******* *************** @127.0.0.1>...
STB (s.******@tin.i t) writes:
devo migliorare delle performance di accesso ad una tabella...
la tabella non ha indice primario, ne altri indici...
sulla tabella ci accedo con select di questo tipo..

select @ExistInOAG = count(*)
FROM caprs05dev.dbo. OAG
WHERE Air_Carrier = @Aircarrier and
cast(ltrim(rtri m(Flt_nbr)) as int) =
cast(ltrim(rtri m(@ComFltNbr)) as int) and
Aipt_Dpt = @AIPTDep and
Aipt_Des = @AIPTDst and
DT_FLIGHT = @Date_Rif and
convert(varchar , STD, 102) = convert(varchar , @STD,
102) and
convert(varchar , STA, 102) = convert(varchar , @STA,
102)

ho provato a creare diversi tipi di indici, ma le performance migliori
le ottengo se lascio stare tutto come era senza nessun'indice!! !! vi
sembra possibile???
le prove che ho fatto sono queste...

inserire un indice tipo Primary con i campi
Flt_nbr,Aipt_Dp t,Aipt_Des,STD, STA
create Unique, tipo Index, con Ignore duplicate key...
create as clustered checcato e fill factor 100%... ci accedo
praticamente solo in select nel file...


Un indicie con Flt_nbr come il primo campo non è molto bene, ecco
perchè:

cast(ltrim(rtri m(Flt_nbr)) as int)

Come Flt_nbr si apparire in un'espressione, SQL Server non può usare
l'indice. Questo è una regola basico del indice in SQL Server.

Non so esato la definizione di questa tabella, e non so la distribuzione
di data. Ma solamente i campi Air_Carrier, Aipt_Dpt, Aipt_Des e DT_FLIGHT
sono buoni per un indice nel questo SELECT. Forse un indici clustered
con (Air_Carrir, Aipt_Dpt) e un buon alternativo.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2838
by: Berserk | last post by:
Sapeto dove posso trovare una tabella sql con l'elenco di tutti i comuni magari aggiornata al 2003? Cerco una versione che contegna questi campi: Codice, Denominazione, esistenza, targa_provincia, cap, prefisso, codice_istat, codice_imps, Codice_Info_Camere, Codice_CPI So della sua esistenza perché ho un cliente che la possiede e non la vuole dare. Vi ringrazio anche se temo che molti di voi ignoreranno questo msg.
2
1913
by: STB | last post by:
ciao a tutti... ci risono... devo migliorare delle performance di accesso ad una tabella... la tabella non ha indice primario, ne altri indici... sulla tabella ci accedo con select di questo tipo.. select @ExistInOAG = count(*) FROM caprs05dev.dbo.OAG WHERE Air_Carrier = @Aircarrier and cast(ltrim(rtrim(Flt_nbr)) as int) =
1
1919
by: melogranina | last post by:
Salve! Ho la necessità di creare un documento xsl con una tabella che deve avere i campi della stessa lunghezza del valore ottenuto da una funzione javascript: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:template match="/">
1
2710
by: SAN CAZIANO | last post by:
selezionare il valore di una SELECT sapendo il testo che deve avere tra le sue opzioni <select name="combo"> <option>nome</option> <option>cognome</option> <option>prova</option> <option>forse</option> </select>
0
4880
by: Luis Esteban Valencia | last post by:
Hello I have this error when I submit the page with the following code. I had never see this kind of errors. Thanks private void btnsubmit_Click(object sender, System.EventArgs e) { string requestLocation = "http://estacion15/HTTPSender/BTSHTTPReceive.dll";
1
1840
by: thirunavukarasukm | last post by:
I have a link wich opens a the second page with links wich call a javascript function. I have some problem with javascript. i am two aspx page.. in my first aspx page contain the second aspx page name.. i am clicking the second page link the second page is opened..
4
4677
by: goosfancito | last post by:
hola. Quiero saber como hacer para identificar de que tipo es un archivo, como ser: quiero que el usuario seleccione un archivo excel y despues poder verificar que asi es y que no es un archivo que se renombro con extension excel. Graicas.
3
3279
by: filippo nanni | last post by:
Hello, I have a series of xml tables that i should convert to html code - Here is an Example: <TABELLA data_mod="2008-10-30 12:20:59" id="2903" locale="it_IT" colonne="1" righe="2" colonna_1="100%"> <grown> <TAB_2903> <story> <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:trows="2"...
0
8130
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8576
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8429
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7091
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4050
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4121
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1423
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.