anonīms Posted June 2, 2010 Report Share Posted June 2, 2010 (edited) Nez no kuriens izmeties errors "Out of memory". Līdz šim nekādu problēmu nebija, bet te pēkšņi ne no kurienes. http://paste.php.lv/67bcb81c1eef84eeec2f62bf2a055285?lang=php SQL Ieraksti > 1'000 Edited June 2, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
aldis Posted June 2, 2010 Report Share Posted June 2, 2010 httpd.conf - tur atmiņu uzliec lielāku? Nu ja serveris tavs. Bieži defaulti tiek iedoti gaužām mazi griesti - piemēram wamp-iem, un visiem šitiem bij 16M, ja ne 4M - kas ir gaužām maz priekš daudz pieprasījumu apstrādes. Quote Link to comment Share on other sites More sharing options...
anonīms Posted June 2, 2010 Author Report Share Posted June 2, 2010 Un, ja hostings nav mans, bet ir firma? Rakstīt supportam? Quote Link to comment Share on other sites More sharing options...
codez Posted June 2, 2010 Report Share Posted June 2, 2010 .htaccess failā: php_value memory_limit 16M Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted June 2, 2010 Report Share Posted June 2, 2010 Nez no kuriens izmeties errors "Out of memory". Un kaa pats domaa?? ja izveido viraku 100Miljonu lielu tabulu? 3 SELEKTI ar UNION ... vajprats .. rekjini ka jau 2 tabulas sada veida dotu ~~1000X1000 ierakstu .. shamo pareizini vel ar 1000 un buus jau Miljards ierakstu ... Izmanto JOIN xx ON xx=yy varjantu tad shaada problema nebuus ... P.S. tava varjantaa tiek izmantoti VISI ieraksti, un tikai peec tam atselekteeti nepieciesamie .. Quote Link to comment Share on other sites More sharing options...
anonīms Posted July 11, 2010 Author Report Share Posted July 11, 2010 (edited) Khm.. Beidzot pieķēros šai lietai klāt, bet īsti nesanāk. Mēģināju šādi: SELECT SUM(km1_rez) as rezulats1, SUM(km2_rez) AS rezulats2, km1 AS komanda, km2 AS komanda FROM ".PREFIX."ligas_speles AS e LEFT OUTER JOIN ".PREFIX."ligas_speles AS f ON e.km1 = f.km2 GROUP BY komanda ORDER BY rezulats1+rezulats2 DESC bet izmet erroru Column 'km1_rez' in field list is ambiguous Edited July 11, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted July 11, 2010 Report Share Posted July 11, 2010 (edited) izmanto e.km1_rez jo shaja gadijuma SQL isti nesaprot no kuras Virtualas tabulas njemt selectu ... (tas nekas ka reali ir tikai 1 fiziska tabula ) (izskatas ka tiek sasumeeti VISI rezultati no abam tabulam tas ir ka jau mineju 1000X1000 ( 1 m ieraktu , sasumejot tur atri var parsniekt atljauto lielumu (int ) Edited July 11, 2010 by Grey_Wolf Quote Link to comment Share on other sites More sharing options...
anonīms Posted July 11, 2010 Author Report Share Posted July 11, 2010 (edited) nu es vēl pielikšu where ligas_id = ?, bet tālāk (ja pat pirmajā kodā teica, ka vispirms tiek atlasīti visi rezultāti) es nesaprotu, jo reāli 1 kodā ar jau bija where ligas_id = ? EDIT: SELECT SUM(e.km1_rez) as rezultats1, SUM(e.km2_rez) AS rezultats2, e.km1 AS komanda1, e.km2 AS komanda FROM ".PREFIX."ligas_speles AS e LEFT OUTER JOIN ".PREFIX."ligas_speles AS f ON e.km1 = f.km2 WHERE e.ligas_id = '".$league['id']."' AND f.ligas_id = '".$league['id']."' GROUP BY komanda1 LIMIT 10 Šādi ar nesaskaita ne pareizi golus, ne arī netiek komanda izvadīta 1x. Esmu strupceļā Edited July 11, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted July 13, 2010 Report Share Posted July 13, 2010 Šādi ar nesaskaita ne pareizi golus, ne arī netiek komanda izvadīta 1x. Esmu strupceļā Kada tev ir isti tebulas struktura un kadu gala rezultatu velies dabuut.. cik noprotu tur ir kautkadas speles & kautkadas komandas & punkti (varti/goli ) varbut pilnibaa nepareizi veido pieprasijumu Quote Link to comment Share on other sites More sharing options...
anonīms Posted July 14, 2010 Author Report Share Posted July 14, 2010 (edited) CREATE TABLE IF NOT EXISTS `ligas_speles` ( `id` int(11) NOT NULL auto_increment, `PO` tinyint(1) NOT NULL default '0', `karta` varchar(5) NOT NULL, `km1` int(11) NOT NULL, `km1_rez` int(2) NOT NULL, `km2` int(11) NOT NULL, `km2_rez` int(2) NOT NULL, `kapteinis1` int(20) NOT NULL, `kapteinis2` int(20) NOT NULL, `izspelets` tinyint(1) NOT NULL, `ligas_id` int(10) NOT NULL, `OT` tinyint(1) NOT NULL default '0', `datums` int(10) NOT NULL, `admins` int(11) NOT NULL, `TZ` tinyint(1) NOT NULL, PRIMARY KEY (`id`) ) iepildīta db INSERT INTO `ligas_speles` VALUES(1458, 0, '', 2, 2, 15, 1, 242, 302, 1, 2, 1, 1279092202, 1, 0); INSERT INTO `ligas_speles` VALUES(1459, 0, '', 15, 6, 2, 4, 302, 242, 1, 2, 0, 1279092222, 1, 0); INSERT INTO `ligas_speles` VALUES(1460, 0, '', 8, 5, 12, 4, 133, 19, 1, 2, 1, 1279092280, 1, 0); INSERT INTO `ligas_speles` VALUES(1461, 0, '', 16, 5, 12, 2, 250, 19, 1, 2, 0, 1279092305, 1, 0); INSERT INTO `ligas_speles` VALUES(1462, 0, '', 16, 4, 12, 1, 250, 19, 1, 2, 0, 1279092321, 1, 0); INSERT INTO `ligas_speles` VALUES(1463, 0, '', 26, 4, 12, 2, 367, 19, 1, 2, 0, 1279092338, 1, 0); INSERT INTO `ligas_speles` VALUES(1464, 0, '', 16, 2, 11, 1, 250, 87, 1, 2, 0, 1279092414, 1, 0); INSERT INTO `ligas_speles` VALUES(1465, 0, '', 11, 4, 24, 3, 87, 199, 1, 2, 0, 1279092447, 1, 0); INSERT INTO `ligas_speles` VALUES(1466, 0, '', 24, 3, 12, 2, 199, 19, 1, 2, 0, 1279092477, 1, 0); Edited July 14, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
marrtins Posted July 14, 2010 Report Share Posted July 14, 2010 Kas ta izmet to Out of memory? MySQL? PHP? Kernelis? Quote Link to comment Share on other sites More sharing options...
anonīms Posted July 14, 2010 Author Report Share Posted July 14, 2010 visdrīzāk, ka PHP. 1 temata atbildē ir redzams SQL vaicājums kāds tiek izmantots. Quote Link to comment Share on other sites More sharing options...
marrtins Posted July 14, 2010 Report Share Posted July 14, 2010 Bet precīzs kļūdas paziņojums nav? Quote Link to comment Share on other sites More sharing options...
anonīms Posted July 14, 2010 Author Report Share Posted July 14, 2010 Nē. Tas arī ir kļūdas paziņojums "Out of memory. Needed 141515151617 (random cipari)" Quote Link to comment Share on other sites More sharing options...
mefisto Posted July 14, 2010 Report Share Posted July 14, 2010 Nu neko darīt , vajadzēs tev SQL iemācīties. Šitas viss kods ir nelietojams : http://paste.php.lv/67bcb81c1eef84eeec2f62bf2a055285?lang=php Kāpēc tu vienkārši nevarētu turēt kopējos spēles rezultātus citāt tabulā, nevis katru reizi rēķināt rezultātu? Tas tavs veidojums pilnīgi notaikit nav 3NF. Un na*uj tu katra rezultāta izdrukāšanai taisi jaunu selectu nu kura tu iegūšti tikai vienu tabulas rindu ? Problēma nav tikai tai vienā querijā , bet gan visā tavas DB arhitektūrā. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.