Saturday, July 4, 2009

Thouands of thousand records

ဒီေန႕ Database ထဲက Row ေပါင္း ၇ ေသာင္းေလာက္ ကို ဘယ္လို Display ျပရင္ေကာင္းမလဲဆိုတာ စဥ္းစားမိတယ္။ အခု လုပ္ေနတဲ့ Project က row ေပါင္း ၇ ေသာင္းေက်ာ္မယ္တဲ့။

အခုစမ္းေနတာ ၂၀၀၀ ေလာက္တင္ Datagridview မွာ သိပ္အဆင္မေျပဘူး။ ေနာက္ေတာ့ web မွာလို page ေတြ ခြဲထုတ္ဖုိ႕ ဆံုးျဖတ္လုိက္တယ္။ Access မွာေတာ့ MySQL Limit မရိွဘူး။ wiki [1] အကူအညီနဲ႕ Top နဲ႕ လုပ္ရတယ္ ဆိုတာ သိသြားတယ္။
Access မွာpage 1 မွာ ၅၀ ျပျပီးသြားရင္ page 2 ကိုselect top 50 * from table where ID Not IN (select top 50 * from table)
အဲလိုေလး ျပန္ထိန္းရတယ္။ ေနာက္ကေတာ့ where နဲ႕ filter ျပန္လုပ္ရတယ္။ ပါျပီးသား ID ေတြ မဟုတ္တာဆိုျပီး ေရြးထုတ္လိုက္တဲ့ ပံုေလးေပါ့။ page ခြဲပံု idea ကိုေတာ့
http://code.mysteryzillion.org/article/separate-page-from-row-record
မွာ ဖတ္ႏိုင္ပါတယ္။ ကၽြန္ေတာ္တို႕ေတြအေနနဲ႕ record ေတြမ်ားလာေလေလ… အမ်ားၾကီးကို တစ္ခါတည္း တန္းမျပပဲ page ေလးေတြ ခြဲလိုက္ျခင္းဟာ အသံုးျပဳသူအတြက္ ေတာ္ေတာ္အဆင္ေျပေစပါတယ္။ Memory သံုးတာ ေတာ္ေတာ္သက္သာသြားတယ္။ Database သံုးတာ ေတာ္ေတာ္သက္သာသြားတယ္။ အခုေတာ့ အဆင္ေျပသြားပါျပီဗ်ာ။
http://en.wikipedia.org/wiki/Select_(SQL)#Limiting_result_rows

Related Posts
MySQL Reference Book
CSV to Mysql
Database Charset UTF-8

0 comments: