473,830 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question on database structure

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi people,

I want to migrate some old mysql-databases to postgresql.
With this step I want to optimize some database structures.

I have a (mysql-) database with all zip-codes and cities in germany.
As there are a lot of them I decided to split them in more tables at that time.
So now there are 10 tables with zip-codes (those starting with '0' in one table, those starting with '1' in another table, and so on).

I also have all streets of germany with their corresponding zip code.
Like the zip-code tables the streets are also splitted in 10 tables (same scheme as above).

My question now is, whether to keep that structure or to throw them together in two big tables?
For accessing that data it would be easier to make two tables, but I don't know what about performance (cause the street-table would have something about one million tuples)?

Thank you for your help!

Greetings,
Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)

iD8DBQE/qVWAtbkSnV7uFrY RArUDAJ9DqzANtI kgEpms2p5GGt01T 27BqwCgj3jn
1ljUP9Dxx9t1Hvm h/3VVWvY=
=v2x8
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #1
2 1427
Simon Stiefel wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi people,

I want to migrate some old mysql-databases to postgresql.
With this step I want to optimize some database structures.

I have a (mysql-) database with all zip-codes and cities in germany.
As there are a lot of them I decided to split them in more tables at that time.
So now there are 10 tables with zip-codes (those starting with '0' in one table, those starting with '1' in another table, and so on).

I also have all streets of germany with their corresponding zip code.
Like the zip-code tables the streets are also splitted in 10 tables (same scheme as above).
My question now is, whether to keep that structure or to throw them together in two big tables?
For accessing that data it would be easier to make two tables, but I don't know what about performance (cause the street-table would have something about one million tuples)?


You are going to have nightmares for your queries then.

How much rows you will have in these two tables ?

With postgres Tables of milions rows with the right index are queried in
few millisecond.
Regards
Gaetano Mendola

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gaetano Mendola wrote:

You are going to have nightmares for your queries then.
Well, it's ok. As far as I know the zip code I can modify my query.
But it would be better, if I don't have to think about that modification.
How much rows you will have in these two tables ?
There would be about 1,2 million rows altogether.
With postgres Tables of milions rows with the right index are
queried in few millisecond.


Ah, thats good to hear.
So I'm going to throw them together. :)

Thanks for your help!

Greetings,
Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)

iD8DBQE/qpLytbkSnV7uFrY RAqH/AJwJqWbqdcPFBV5 ZPUmZBVCMgf0ANw CfYiAZ
5JVnrHBFDnN97lX xCooc008=
=5V/E
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
11480
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a database, and I need the data to be laid out in a tabular format, and set out in a specific way. At the current point in time, I am copy/pasting the raw text from the database into a table layout in InDesign. What I was thinking is that if I could...
9
2025
by: Weekend | last post by:
Currently, i want to develope a multiple choice exam website. The content of the test is store in an XML file. I want to carry out some function. Could you tell me which programming language should i use? 1.A page that display the content of the XML file. (JavaScript, JSP, XSL, DOM, DSO ActiveObject control ?) 2.A page that Give the feeback to the users who finished the exam. (this part i would like to use JSP) 3.A page that enable me to...
22
2142
by: Nunaya | last post by:
We have developed two objects called "customer" and "salesrep". For simplicity, assume that these two objects will talk directly to a database. The database has three tables: customers, customersalesreps (allows multiple salesreps to be associated with a customer), and salesreps. The customer object has business rules that allow manipulation of customer information (add,update,delete,select,etc). The salesrep object has business rules...
11
3196
by: theshowmecanuck | last post by:
As a matter of academic interest only, is there a way to programmatically list the 'c' data types? I am not looking for detail, just if it is possible, and what function could be used to accomplish it. For example: int main void() { while there are more data types { print next data type; }
14
1467
by: Frank Rizzo | last post by:
I realize that this maybe the wrong forum, but maybe someone has run into this situation before. I sell an app and I want to offer my customers a migration path from a competing product. However, my competitor stores all data in an Microsoft Access database, which is password protected. Now, I can easily break the password and export all the data necessary into my app. In fact, I did break the password by downloading a $10 app from the...
14
1852
by: Mr Newbie | last post by:
I am often in the situation where I want to act on the result of a function, but a simple boolean is not enough. For example, I may have a function called isAuthorised ( User, Action ) as ????? OK, this function may return a boolean, and if this is true, then no message back is really required, but if it fails then some supporting message needs to be returned to the calling code. As I see it there are a few options.
29
3589
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this one data field - but i'm not sure) :-) Background info:
7
1204
by: Steve Barnett | last post by:
I have a database with two tables "Structure" and "Data". The Data table contains the data for my application, so no problem there. The Structure table effectively puts some organisation to the Data table. It contains a "tree structure" of records linked by parent/child/sibling pointers plus the key of the data record that it refers to. It is possible for the same data record to be referred to in more than one place in the structure. ...
8
1123
by: Flack | last post by:
Hey guys, I'm in the process of designing a small app that will be used by myself and a few other people. Now, there is some data that this app will need to run. I know it is possible to put this data, for example, in an Access database and include it with the app. However, I was wondering if it would be a better idea to just include the data directly in my app. There isn't a huge amount of data and it will rarely, if ever, change. ...
6
1711
by: RSH | last post by:
I am still trying to grasp the use of real world Objects and how to conceptualize them using a business scenerio. What I have below is an outline that I am wrestling with trying to figure out a class structure:\ Top level Objects: Companies Employees
0
9786
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9641
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10769
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10479
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10199
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7741
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5616
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5778
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4409
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.