Re: q:Subqueries

From: PKelley772 <pkelley772_at_aol.com>
Date: 1995/08/26
Message-ID: <41oaj5$nn1_at_newsbf02.news.aol.com>#1/1


Re "why I might want to load data in a particular order":

Folklore suggests that order by can really slow things down in large tables. I'm also told that you can, in some cases, get ordered data back without using order by or group by.

I 've heard 2 theories on this, but have tested neither.

  1. (I have no idea if this is true) If you load your data ordered the way you're most likely to need it you will reap performance benefits - you won't have to use "order by", and so your queries will run more quickly.
  2. I've heard that if you use an index on your table, and if you retrieve using the index without using an "order by" statement, your data comes back in index order. This seems reasonable to me.

I'll test these out when I get a chance. Before you flame me for this, I should tell you that some of the tables I am starting to work with have 20 million rows. If you don't have experience with such quantities of data,  you might not be in a very good position to mount an attack. If you see some contradictions here that I've missed, fire away.   Received on Sat Aug 26 1995 - 00:00:00 CEST

Original text of this message