marrtins Posted January 30, 2013 Report Share Posted January 30, 2013 Ja jau dati nemainās, vēl ir variants: sadala pa tabulām, katrā pa 50`000 vai 100`000 ierakstiem :) Quote Link to comment Share on other sites More sharing options...
daGrevis Posted January 30, 2013 Report Share Posted January 30, 2013 `users1`, `users2`, `users3`?? That's sick. :D Quote Link to comment Share on other sites More sharing options...
marrtins Posted January 30, 2013 Report Share Posted January 30, 2013 Nekas sikk tur nav. Tā mēdz darīt. Tūkstotis vai vairāk tabulu ;) Quote Link to comment Share on other sites More sharing options...
codez Posted January 30, 2013 Author Report Share Posted January 30, 2013 Ja dala pa grupām, tad pa tabulām nevajag dalīt. Uzliek vēl vienu parametru - subgroup un uztaisa indeksu subgroup,id un tad atlasa SELECT * FROM test WHERE subgroup=123 ORDER BY id 5000,10 Attiecīgi, viņš where atradīs, izmantojot indeksu un tikai no tās vietas sāks fullscanu uz 5010 rindām. Quote Link to comment Share on other sites More sharing options...
marrtins Posted January 30, 2013 Report Share Posted January 30, 2013 (edited) Nu tā arī var, protams. Vēl var paspēlēties ar partiotioning: http://www.tritux.com/blog/2010/11/19/partitioning-mysql-database-with-high-load-solutions/11/1 Pats gan neesmu šo izmantojis un nez cik tas labi darbojas. Edited January 30, 2013 by marrtins Quote Link to comment Share on other sites More sharing options...
zuks Posted January 30, 2013 Report Share Posted January 30, 2013 (edited) Ja reāli ir nepieciešama veiktspēja un servera atmiņa ir jāiet uz partitioning , pēdējais rezultāts bija 350% ātrdarbība pie pareiziem predicatiem un pareizi saparticionētiem indexiem papildus ja db ir hiarhiski pareizi un korektiem datiem bērnu tabulas pēc references un uz join būs vēl papildus efektivitāte , ja datus izmantojam tikai selectam vēl saarhivējam atsevišķās partīcijas un iegūstam vērtīgo atmiņas sektoru. Tikai ieteiktu atcerēties partitioning can save you or kill you ! Edited January 30, 2013 by zuks Quote Link to comment Share on other sites More sharing options...
zuks Posted January 30, 2013 Report Share Posted January 30, 2013 Pašreiz tiek nobeigts select * from table(dbms_xplan.display); Plan hash value: 675508361 ---------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1325K| 734M| 631K (3)| 00:25:25 | |* 1 | TABLE ACCESS FULL| ***************** | 1325K| 734M| 631K (3)| 00:25:25 | ---------------------------------------------------------------------------------------------- Rezultāts select * from table(dbms_xplan.display); Plan hash value: 1163575294 -------------------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop | -------------------------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 5256K| 21G| 17021 (1)| 00:00:42 | | | | 1 | PARTITION LIST SINGLE | | 5256K| 21G| 17021 (1)| 00:00:42 | KEY | KEY | | 2 | PARTITION RANGE SINGLE | | 5256K| 21G| 17021 (1)| 00:00:42 | 3 | 3 | |* 3 | TABLE ACCESS BY LOCAL INDEX ROWID| ************************ | 5256K| 21G| 17021 (1)| 00:00:42 | 3 | 3 | |* 4 | INDEX RANGE SCAN | ****************** | 11M| | 16361 (1)| 00:00:40 | 3 | 3 | -------------------------------------------------------------------------------------------------------------------------------- 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.