Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Długi czas "sending data" na jednym serwerze i krótki na drugim
TomASS
post
Post #1





Grupa: Zarejestrowani
Postów: 1 660
Pomógł: 13
Dołączył: 9.06.2004
Skąd: Wrocław i okolice

Ostrzeżenie: (0%)
-----


Mam dwa serwery - "serwer A" oraz "serwer B"

z serwera A skopiowałem na B tabele potrzebne do zapytania:
  1. SELECT * FROM m_transporty_miejsca AS TM LEFT JOIN m_transporty AS T ON (T.ID=TM.ID_transport)


oczywiście indeks na TM.ID_transport jest
m_transporty_miejsca = 800.000 rekordów
m_transporty = 300.000 rekordów

na serwerze A zapytanie wykonuje się 80-90 sekund (całość to "sending data")
a na serwerze B zapytanie wykonuje się 0.01 sekundy

czym to może być spowodowane?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
TomASS
post
Post #2





Grupa: Zarejestrowani
Postów: 1 660
Pomógł: 13
Dołączył: 9.06.2004
Skąd: Wrocław i okolice

Ostrzeżenie: (0%)
-----


Jasne, że szukałem.
Nic konkretnego nie znalazłem (poza indeksami)

Np.

Cytat
An explain-plan is usually the best place to start whenever you have a slow query. To get one, run

DESCRIBE SELECT source_id FROM directions WHERE (destination_id = 10);

This will show you a table listing the steps required to execute your query. If you see a large value in the 'rows' column and NULL in the 'key' column, that indicates that your query having to scan a large number of rows to determine which ones to return.

In that case, adding an index on destination_id should dramatically speed your query, at some cost to insert and delete speed (since the index will also need to be updated).



ale indeks mam
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.10.2025 - 18:31