![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 173 Pomógł: 1 Dołączył: 4.05.2010 Ostrzeżenie: (20%) ![]() ![]() |
Witam,
Mamy na aukcje.fm na dole panel losujący aukcje użytkownika lecz poprzez ORDER BY RAND( ) praca jest powolna i ogólnie obciąża serwer głównie gdy użytkownik ma ponad 100K aukcji i wchodzi bot + ruch ludzi. W procesie sql to ciągle to samo zapytanie SELECT * FROM `tabela1` WHERE `user` = "200" AND `closed` =0 AND `suspended` =0 ORDER BY RAND( ) Kod php
Jak można np. dać losowanie szybsze lub nie z pośród całości 100K rekordów lecz z np 200 rekordów od numeru ID aktualnej aukcji. Lub jest inny sposób? |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 561 Pomógł: 72 Dołączył: 15.11.2006 Ostrzeżenie: (0%) ![]() ![]() |
LOL:
Cytat Warning: mysql_connect() [function.mysql-connect]: Too many connections in /data/aukcjefm/aukcje.fm/includes/settings.inc.php on line 34 Warning: mysql_select_db() [function.mysql-select-db]: Too many connections in /data/aukcjefm/aukcje.fm/includes/settings.inc.php on line 37 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /data/aukcjefm/aukcje.fm/includes/settings.inc.php on line 37 Warning: mysql_query() [function.mysql-query]: Too many connections in /data/aukcjefm/aukcje.fm/includes/settings.inc.php on line 40 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /data/aukcjefm/aukcje.fm/includes/settings.inc.php on line 40 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /data/aukcjefm/aukcje.fm/includes/settings.inc.php:34) in /data/aukcjefm/aukcje.fm/includes/settings.inc.php on line 42 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /data/aukcjefm/aukcje.fm/includes/settings.inc.php:34) in /data/aukcjefm/aukcje.fm/includes/settings.inc.php on line 42 Warning: mysql_query() [function.mysql-query]: Too many connections in /data/aukcjefm/aukcje.fm/includes/https.inc.php on line 7 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /data/aukcjefm/aukcje.fm/includes/https.inc.php on line 7 Chyba już się im ktoś wziął za bezpieczeństwo (IMG:style_emoticons/default/winksmiley.jpg) |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 1 873 Pomógł: 152 Dołączył: 9.04.2006 Skąd: Berlin Ostrzeżenie: (0%) ![]() ![]() |
Musiałeś wejść w trakcie kopiowania bazy danych do pliku albo testów. (IMG:style_emoticons/default/smile.gif) Zająłem się już tym i działa. Powiem tylko, że użyłem MIN(), MAX() i odpowiednio to obrobiłem:) Jest może 10 zapytań, ale bardzo wydajnych. |
|
|
![]() ![]() |
![]() |
Aktualny czas: 8.10.2025 - 15:36 |