> Hi, > > I'm new here and because of that I would like to say hello to You. > > I've created a database (Firebird 2.x) and connect to it with dot net > provider from Visual Studio 2005. > > I take some rows from database (about 3 000 000 rows) with a query as > simple as this: > > Select * from Table where POSTAL_CODE = 84652 > > (Yes, I have an index upon this column. The column POSTAL_CODE is not > unique) > > But unfortunately, when I use code like this: > > FbCommand cmd = new FbCommand(); > cmd.CommandText = "Select * from Table where POSTAL_CODE = 84652"; > cmd.Connection = conn; > FbDataAdapter da = new FbDataAdapter(cmd); > da.Fill(dt); > > I'm waiting for aproximately 4 seconds, and that's too long. Yes, I > know, 3 000 000 rows, > It can be so long, but a program called "IBEasy+" gets the same result > with the same > Query in about, i don't know... a small part of one second :) Just I > call "Execute query" > And voila - I have my results. > > And here is my question, please help me! I would approciate it very > much! > What is wrong with my code? > > Greetings, > Tom
IBEasy is not retrieving all the records in the set. It's retrieving only what's required to fill it's grid and some more for buffer space. The API provides for this by way of "getting next record". You go a layer above the API and this control is not always provided. IBObjects provides for this control to fill IT's native grid controls. But other controls (grids?) do not have the intelligence to stipulate how many records it's needs for buffer space etc etc. So you're left with retrieving all the records. You're lucky you're not trying this over low bandwidth. 4 seconds would turn into 14 minutes alan ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Firebird-net-provider mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
