how to make select fast use ODBC
-
I use VFP98 open a database named abc.dbf,only spend 5 second include show all the data in database. But,when I use ODBC API open the abc.dbf,and show all the data ,It spend much more times,and make the computer shutdown!!(There is not enough memory!!) Thanks! hi
-
I use VFP98 open a database named abc.dbf,only spend 5 second include show all the data in database. But,when I use ODBC API open the abc.dbf,and show all the data ,It spend much more times,and make the computer shutdown!!(There is not enough memory!!) Thanks! hi
how are you using the odbc stuff? you posting doesnt give enough details to say much about what is causing the problems --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
how are you using the odbc stuff? you posting doesnt give enough details to say much about what is causing the problems --- "every year we invent better idiot proof systems and every year they invent better idiots"
Sorry,the following is the detail! Notice: The abc.dbf has 500 million records!!!! The code is too long,I can only give you virtual code!(Using VC++ with ODBC API) 1.SQLDriverConnect(); //connect the database abc.dbf . 2.SQLSetStmtOption(...SQL_CURSOR_DYNAMIC);//Create a scrollable cursor. 3.SQLExecDirect(); //Execute SQL directly.(Select * from tablename) 4.SQLNumResultCols(); //Get selected column numbers.(The fields count) 5.SQLDescribeCol(); //Save column describe in an object array. 6.SQLBindCol(); //Bind every column(fields) with a variable which described in step 5.Saved in an object array. 7.SQLFetchScroll(...SQL_FETCH_LAST);//Move cursor to last record,to get selected records count!It related to step 6. 8.Use ListView show the records data which saved in an object array in setp 6. Notice: whith the 500 million records. Setp 1 to 6 spend a few second,but in step 7,it take much more time ,and make my compter shutdown because there is not enough memory! Thanks! hi
-
Sorry,the following is the detail! Notice: The abc.dbf has 500 million records!!!! The code is too long,I can only give you virtual code!(Using VC++ with ODBC API) 1.SQLDriverConnect(); //connect the database abc.dbf . 2.SQLSetStmtOption(...SQL_CURSOR_DYNAMIC);//Create a scrollable cursor. 3.SQLExecDirect(); //Execute SQL directly.(Select * from tablename) 4.SQLNumResultCols(); //Get selected column numbers.(The fields count) 5.SQLDescribeCol(); //Save column describe in an object array. 6.SQLBindCol(); //Bind every column(fields) with a variable which described in step 5.Saved in an object array. 7.SQLFetchScroll(...SQL_FETCH_LAST);//Move cursor to last record,to get selected records count!It related to step 6. 8.Use ListView show the records data which saved in an object array in setp 6. Notice: whith the 500 million records. Setp 1 to 6 spend a few second,but in step 7,it take much more time ,and make my compter shutdown because there is not enough memory! Thanks! hi
Why can't you just use "select count(*) from ..." instead of traversing 500 million records? Tomasz Sowinski -- http://www.shooltz.com.pl
-
Why can't you just use "select count(*) from ..." instead of traversing 500 million records? Tomasz Sowinski -- http://www.shooltz.com.pl
Thanks! You can resolve the record numbers of the table,but how to show every record data much more fast like VFP98. In my way,I use SQLFetchScroll(...SQL_FETCH_NEXT) to get and show record data one by one,It takes much more time!I want to make it fast,how can I do?:-O hi
-
Thanks! You can resolve the record numbers of the table,but how to show every record data much more fast like VFP98. In my way,I use SQLFetchScroll(...SQL_FETCH_NEXT) to get and show record data one by one,It takes much more time!I want to make it fast,how can I do?:-O hi
You have to use some caching scheme. You simply can't store 500 million records from your table in RAM. Read records in the background thread to improve UI response time. Tomasz Sowinski -- http://www.shooltz.com.pl
-
You have to use some caching scheme. You simply can't store 500 million records from your table in RAM. Read records in the background thread to improve UI response time. Tomasz Sowinski -- http://www.shooltz.com.pl
-
You have to use some caching scheme. You simply can't store 500 million records from your table in RAM. Read records in the background thread to improve UI response time. Tomasz Sowinski -- http://www.shooltz.com.pl
But today I use SQL Server open the same .dbf(conver to .mdb),the SQL Server can not locate the last record in time.But VFP locate the last record in a few seconds.Somebody tell me than VFP use a special technology ,such as RUSHMORE..... Who can tell me how about RUSHMORE?What is the relationship with the SQL?:-O hi