473,395 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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(rtrim(Flt_nbr)) as int) =
cast(ltrim(rtrim(@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_Dpt,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 1904
STB (s.******@tin.it) 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(rtrim(Flt_nbr)) as int) =
cast(ltrim(rtrim(@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_Dpt,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(rtrim(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.it) 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(rtrim(Flt_nbr)) as int) =
cast(ltrim(rtrim(@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_Dpt,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(rtrim(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
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,...
2
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...
1
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"?>...
1
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>...
5
by: Phil Powell | last post by:
I cannot fathom this one.. for some cracked reason, one of my forms is totally OK and the other is apparently nonexistent according to both HTML and Javascript. The second form never submits...
0
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) { ...
1
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...
4
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...
3
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" ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.