473,387 Members | 1,492 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,387 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 2855
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>...
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" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.