🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.delphi.bazy-danych
Article #196

Re: Indeksy a "ORDER BY" w Query [SQL, index, sort]

#196
From: Roman Kowaliszyn
Date: Tue, 20 Apr 1999 15:09
31 lines
1974 bytes
Przemysław Rakowski wrote:
> Nie bylbym taki pewny, czy wykorzystuje... Przetestowalem czas wykonywania
> order by na duzej bazie przed zalozeniem indeksu i po zalozeniu indeksu
> (identycznego z order by).
> W obydwu przypadkach czas byl identyczny i wynosil 4 min 21 sekund.
> Jak to wytlumaczyc w oparciu o zalozenie, ze indeksy za drugim razem zostaly
> wykorzystane?!

Mozliwe, ze zalezy to od implementacji serwera SQL. Dla InterBase'a
help stanowi:

"Nevertheless, the overhead of indexes is usually outweighed by the
boost in performance for data retrieval queries. You should create an
index on a column when:

- Search conditions frequently reference the column.
- Join conditions frequently reference the column. 
- ORDER BY statements frequently use the column to sort data."

(to samo w "Borland InterBase Data Definition Guide" str. 102)

Z tego wynika, ze ORDER BY - przynajmniej w zalozeniach - korzysta
z indeksow.

Pozdrawiam
-- 
Roman Kowaliszyn
DAKAN, Bydgoszcz
romank@interlan.com.pl
delphi_pl-owner@onelist.com
http://www.onelist.com/archives.cgi/delphi_pl
Technical Details
Message-ID: <371C98AC.A1BCD0C3@interlan.com.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!not-for-mail
References: <370c8f58.73849@rymunda.torun.pdi.net> <370FD301.E6E3446E@interlan.com.pl> <371b4201.0@news.vogel.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!not-for-mail
From: Roman Kowaliszyn <romank@interlan.com.pl>
Newsgroups: pl.comp.lang.delphi.bazy-danych
Subject: Re: Indeksy a "ORDER BY" w Query [SQL, index, sort]
Date: Tue, 20 Apr 1999 17:09:32 +0200
Organization: DAKAN sc, interLAN sp z o.o.
Lines: 33
Message-ID: <371C98AC.A1BCD0C3@interlan.com.pl>
References: <370c8f58.73849@rymunda.torun.pdi.net> <370FD301.E6E3446E@interlan.com.pl> <371b4201.0@news.vogel.pl>
NNTP-Posting-Host: pa232.bydgoszcz.ppp.tpnet.pl
Mime-Version: 1.0
X-Trace: flis.man.torun.pl 924641697 1991 212.160.48.232 (20 Apr 1999 20:54:57 GMT)
X-Complaints-To: abuse@man.torun.pl
NNTP-Posting-Date: 20 Apr 1999 20:54:57 GMT
X-Mailer: Mozilla 4.04 [en] (Win95; I)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit