| Author |
Topic |
|
imp_galo
Starting Member
13 Posts |
Posted - 2005-10-21 : 13:21:34
|
| Hi there,I'm working in an sql application and often I have to refer to a small piece of a table, for example to get a Name in a record which I have the ID. I created an array which stores both fields( ID and Name ), but acctualy I don't find it very elegant. So my question is:Is there any way I can create a temporary view or table locally so that I can query data without having to communicate to the server? Or any other suggestion?Some times the connection is very poor and I think it can help to improve my app estability.Thank you very much. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
anuj164
Starting Member
49 Posts |
Posted - 2005-10-21 : 15:56:08
|
| based on what i understood, you are not using join and goping back to the database every time to fetch the name, if that's the case then use Join between both the tables on ID. |
 |
|
|
imp_galo
Starting Member
13 Posts |
Posted - 2005-10-25 : 17:29:40
|
| For example I have an employee name which I display on the screen and I store de employee Id in the memory. Is there any way I can create a table to store this data locally and temporally in a way I can access it often without query to the data base on the server (which consume more band width and makes my application slower).Thank you very much. |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2005-10-26 : 08:13:43
|
| What is your "application". Is it a web site? A console app? A windows app? What are you writing it in?Help us help YOU!Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx*need more coffee*SELECT * FROM Users WHERE CLUE > 0(0 row(s) affected) |
 |
|
|
imp_galo
Starting Member
13 Posts |
Posted - 2005-10-26 : 10:48:16
|
| Ok, sorry I wil try to give you more details.I'm working in a C++ Windows project management application. |
 |
|
|
steamngn
Constraint Violating Yak Guru
306 Posts |
Posted - 2005-10-26 : 20:05:17
|
| If I am reading this right, imp_galo wants to do a query against a database table and then store the output locally; then when he needs data he will reference the stored data rather than re-query the database.This kind of goes against the whole idea of having dynamic data; if the query you are running is small, then the bandwidth saved will be negligible. Plus, any changes to the database will not show up in the stored data unless you re-query anyway!AndyThere's never enough time to type code right, but always enough time for a hotfix... |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-10-26 : 20:19:52
|
| Our developers store data that doesn't change very often into the client's cache. Our client being a web server. This means we getter better performance after the first time when it loads into memory. So the first person who requests the data will receive a hit to load it into memory, but each additional person gets to go directly to cache instead of the database. You should only do this with data that seldom changes. You'll need to design some kind of mechanism to invalidate the cache when a change occurs to the data so that the cache is reloaded.Tara |
 |
|
|
steamngn
Constraint Violating Yak Guru
306 Posts |
Posted - 2005-10-26 : 20:57:34
|
| We do something like that with our zip code data, moving it down to web server with a proc. This proc is run each time the zip_code table gets an update. This puts a little strain on the network when this happens, but it is very rare. Then we have a simple web page to retrieve zip data that the client uses. The upside is the client can retrieve the zip data quickly,and the DB server is not doing retrievals one zip at a time. As you said, Tara, it is data that changes almost never.AndyThere's never enough time to type code right, but always enough time for a hotfix... |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2005-10-26 : 22:05:16
|
quote: Originally posted by imp_galo Ok, sorry I wil try to give you more details.I'm working in a C++ Windows project management application.
You might want to read up on basic C++ data structures ..... this kind of thing doesn't belong in a database forum, but rather a C++ forum. If you are having trouble with arrays and classes in C++, then you might need to step back and brush up on your C++ fundamentals. |
 |
|
|
|