It may be true that "some DBMSs" physically store rows in whatever order
you
speicfy;
That's not what I said.
however, this is a MySQL list, and MySQL does not do this (InnoDB
anyway).
For example, take a table with 10,000,000 rows and run a simple select on
it:
Database changed
mysql> S
It may be true that "some DBMSs" physically store rows in whatever order you
speicfy; however, this is a MySQL list, and MySQL does not do this (InnoDB
anyway).
For example, take a table with 10,000,000 rows and run a simple select on
it:
Database changed
mysql> SELECT id FROM trans_item LIMIT 1\
To further emphasize this point: A table has no order by itself,
That's not entirely true ;-) Records are stored in some kind of physical
order, some DBMSses implement clustered keys, meaning that the
records are stored ascending order on disk.
However...
and you should make no assumptions
To further emphasize this point: A table has no order by itself, and you
should make no assumptions about the order of rows you will get back in a
select statement, unless you use an ORDER BY clause.
Regards,
Gavin Towey
-Original Message-
From: walterh...@gmail.com [mailto:walterh...@
Bill,
if you use an order by clause in your query, the limit will pick the first
100K rows in that order. That way you can ensure that all rows will be
processed in (wait for it...) order :)
Cheers,
Walter
On Tue, Aug 18, 2009 at 18:44, Bill Arbuckle wrote:
> I am in need of some help for the
I am in need of some help for the following:
Say I have a table with 1M rows. Users are being added constantly (not
deleted) during the queries that I am about to explain. The pk is uid and
appid. I need to run queries in increments of 100K rows until reaching the
end without duplicating row
On Tue, Aug 18, 2009 at 5:08 AM, Simon Kimber wrote:
> I have indexes on siteid, datestamp and msgtype.
>
> Queries such as the following are constantly appearing in the slow
> queries log:
>
> SELECT * FROM enquiries WHERE siteid = 59255 AND msgtype = 0 ORDER BY
> datestamp DESC LIMIT 5;
Read the
Salam buat anda yang saya hormat, Saya memohon maaf kerana emel yang tak
diundang ini.
Sebagai seorang Pemasar Internet Sambilan,
saya sentiasa mencari dan terus mencari ruang
dan peluang bagaimana merealisasikan impian
menjana pendapatan sebenar dari usaha dan modal
yang telah dikorbankan.
Bagai
Simon Kimber schrieb:
> Hi Everyone,
>
> I'm having a very simple query often take several seconds to run and
> would be hugely grateful for any advice on how i might spped this up.
>
> The table contains around 500k rows and the structure is as follows:
>
> +---+--+
Hi Everyone,
I'm having a very simple query often take several seconds to run and
would be hugely grateful for any advice on how i might spped this up.
The table contains around 500k rows and the structure is as follows:
+---+--+--+-+---+---
10 matches
Mail list logo