>Hi,
>
>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)

Try adding the PLAN statement into you query like;
SELECT * FROM Table_Name WHERE POSTAL_CODE = 84652 PLAN (Table_Name
INDEX (INDEX_NAME))

>FbCommand cmd = new FbCommand();
>cmd.CommandText = "Select * from Table where POSTAL_CODE = 84652";
>cmd.Connection = conn;
>FbDataAdapter da = new FbDataAdapter(cmd);
>da.Fill(dt);

Are you filling a datatable or dataset? If you are filling a dataset and
don't need a relational join, then try using a data table instead, like
this.

Datatable dt = new Datatable(); 
FbCommand cmd = new FbCommand();
cmd.CommandText = "Select * from YourTableName WHERE POSTAL_CODE = 84652
PLAN (YourTableName INDEX (NameOfYourIndex))";
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.

To further optimize this you may look into creating objects instead of
data tables. Getting 3 million rows in 4 seconds is not to bad. Maybe
you should look at how to reduce the amount of data being transferred
over the wire, limit the columns coming back to you, or figure out a way
to limit how much you are selecting at one time. It just seems like a
lot of info to bring to the client.

Steven Ramacher



-------------------------------------------------------------------------
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

Reply via email to