MySQL Forums
Forum List  »  German

Re: Myisam Table im RAM bearbeiten
Posted by: Thomas Wiedmann
Date: August 17, 2012 12:36AM

Hallo Bernd,
zeige doch mal die Tabellenstruktur von der Tabelle und ein paar Testdaten (INSERT).

mysql>SHOW CREATE TABLE tabelle1;

sowie:

* SHOW TABLE STATUS LIKE 'tbl'; -- liefert die Tabellengrößen
* SHOW VARIABLES LIKE '%buffer%'; -- wichtige MySQL Server Einstellungen

Durch ein Auftrennen der Tabelle in zwei Tabellen (1:1) läßt sich vielleicht etwas beschleunigen.

CREATE TABLE tabelle1_url (
 id ...
 url ...
);

CREATE TABELLE tabelle1 (
 id ..
 feld1 ..
)

/* in etwa so */
SELECT * 
  FROM tabelle1 t1
  JOIN (SELECT id, url FROM tabelle1_url
        ORDER BY rand()) ...
        LIMIT 10 ) AS r
    ON t1.id = r.id

Order by RAND() ist generell keine gute Lösung, deshalb muss die Datenmenge die sortiert wird, so klein wie möglich gehalten werden.

Grüße
Thomas



Edited 1 time(s). Last edit at 08/17/2012 12:38AM by Thomas Wiedmann.

Options: ReplyQuote


Subject
Views
Written By
Posted
1503
August 16, 2012 05:37PM
Re: Myisam Table im RAM bearbeiten
1069
August 17, 2012 12:36AM
920
August 17, 2012 03:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.