MySQL star database add-on.

Post requests, images, descriptions and reports about work in progress here.
Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

MySQL star database add-on.

Post #1by marc » 06.06.2003, 12:14

Version 0.1.2 of my MySQL star database add-on is finished.

One of the major changes is speed. The initial generation time is 6x faster and queries in general are a little faster.
Ive cleaned up a lot of code so it is almost ready for porting to linux or OSX (though ill need some help on that). Ill get a source distribution out later. Meanwhile if your interested have a look at the CVS repository.

Don't be fooled by the version number this is fully functional. From now on I will only be making minor changes and bug fixes to this add-on.

Download it here. (3 MegaBytes)
https://sourceforge.net/project/showfil ... _id=163947

Tutorial here.
http://mostlyharmless.sourceforge.net/s ... index.html

Changelog here.
http://mostlyharmless.sourceforge.net/m ... c.php?p=82

Info on the previous versions here.
http://www.celestiaproject.net/forum/viewtopic.php?t=2312

Finally the screenshots.
Image

Image

Image
Last edited by marc on 08.06.2003, 16:33, edited 2 times in total.

jrobert
Posts: 95
Joined: 09.08.2002
With us: 22 years 3 months
Location: California, USA
Contact:

Post #2by jrobert » 06.06.2003, 15:22

Totally cool! I'm surprised I didn't know about this before. Thanks marc! :)

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #3by marc » 06.06.2003, 15:40

No worries,

I forgot to mention in the tutorial that this also works with Pascal Hartmann's extended stars.dat files.

http://perso.wanadoo.fr/celestia.stars/

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #4by marc » 08.06.2003, 16:21

Version 0.1.3 is ready.

Only some minor changes to the binary, see the change log.

Ive made a source distribution available as well. The zlib, libpng and mysqld libraries are not included. All my code is surrounded in a number of #defines which are specified in mh_switches.h.

More information.
http://mostlyharmless.sourceforge.net/s ... index.html

Change log.
http://mostlyharmless.sourceforge.net/m ... c.php?p=82

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #5by ElPelado » 08.06.2003, 17:30

i have the 1.3.1pre3 of celestia and when i want to run MySQL it says that it cant read the stars database.

and on the 1.3.0 version that i have, the program(i think, maybe i just had to wait more time) crashes and it doesnt star.
---------X---------
EL XENTENARIO
1905-2005

My page:
http://www.urielpelado.com.ar
My Gallery:
http://www.celestiaproject.net/gallery/view_al ... y-Universe

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #6by marc » 08.06.2003, 18:18

Are you using version 0.1.3?

That error message usually means the generation process didnt work, you need to wait for it to complete.

If you did how long did it take?

Also sometimes on the first run or after a crash the embedded db server does a whole lot of selfchecking and repairing which can take a while.

Do you have the original stars.dat with your celestia or one of Pascals big ones? Try using the original stars.dat first. (its in the data dir and should be about 2.7MB)
How much free harddrive space do you have?

Try running generate_all.bat from the command line in the celestia directory and give me a screenshot of the output once its finished.

The amount of ram is the biggest factor on startup and query time. 128M is not very much ram, which might be causing the problem. However, ive tested it on 256M and it starts up in a few seconds with the standard stars .dat.

Have a look at mh_readme.html and set key_buffer_size=16M in my.ini.

If it still doesnt work try installing it on a fresh 1.3.0 installation of celestia and tell me exactly what you do and what you see.

also have a look at this thread of someone else who had a similar problem with version 0.1.1.
http://mostlyharmless.sourceforge.net/m ... c.php?t=35

hope this helps
Last edited by marc on 08.06.2003, 18:25, edited 1 time in total.

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #7by marc » 08.06.2003, 18:37

Elpelado, one more thing what OS are you running?

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #8by marc » 08.06.2003, 19:03

I just tested it with celestia 1.3.1pre3 and it works fine.

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #9by ElPelado » 08.06.2003, 19:26

marc, it works.
i dont know why. i run again the generate_all(it took less than 2 minutes).
i dont know what was the problem before. but now it works.
there is only one problem: i was doing the tutorial, and in the first thing that you tell us to do(class M distformsol<30), well, i discovered that in my celestia(using the standart stars database) i dont have any star at a distance form sol <30. only >30.

do you still want to know my system?? im using windows 98 SE(in less than a week i will install the XP), 128 MB, GeFroce 2 64MB, pentium 4 1.5GHtz.
---------X---------

EL XENTENARIO

1905-2005



My page:

http://www.urielpelado.com.ar

My Gallery:

http://www.celestiaproject.net/gallery/view_al ... y-Universe

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #10by marc » 08.06.2003, 19:55

The stars should be there, make sure you have turned on star marking with ctrl+k and zoom out a bit. I forgot to put that in the tutorial as well :oops:
Ill have to sneak in a new installer in with an updated tutorial.
Or mabey you are just forgetting to put the quotes around the M like so 'M'

Its good to hear that it works with that much memory.

I strongly suggest you get more memory before you change to XP. XP uses a lot more memory than WIN98 and your system performance will just seem worse. And dont do an 'upgrade'. Back everything up, delete win98 and install XP onto a clean NTFS partition. The upgrade leaves a lot of junk behind. You might prefer to stick to Fat32 so the partition is easily accessable from linux. But by using fat32 you miss out on some XP security and performance.

added later: Im not sure if writing to an NTFS filesystem from linux is stable yet, but i know that reading is possible.

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #11by ElPelado » 09.06.2003, 10:49

about the stars near than 30 ly. i tryed also just puting the command to mark all the stars near than 30, and it doesnt work. is not that i have no M class star, i havo no star.
---------X---------

EL XENTENARIO

1905-2005



My page:

http://www.urielpelado.com.ar

My Gallery:

http://www.celestiaproject.net/gallery/view_al ... y-Universe

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #12by marc » 09.06.2003, 12:07

Do the other queries in the tutorial work ok?

Try this:

SELECT COUNT(*) FROM star;
you should see this overlaid on the screen

Code: Select all

+----------+
| count(*) |
+----------+
|   112520 |
+----------+
1 row in set (0.02 sec)
It tellls you how many stars there are in the database,


MARK STARS WHERE spectralClass='M' AND distFromSol<30;

You should see this.
Image

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #13by ElPelado » 09.06.2003, 12:47

Code: Select all

+----------+
| count(*) |
+----------+
|   112520 |
+----------+
1 row in set (0.02 sec)


thats the problem, i mean, i only have 65000 stars in my database....
what can i do?


when executin the .bat file, there are some errors. i could take this screenshot:
Image

there is also an error when deleting and compressing the file(i dont rememeber the name).
---------X---------

EL XENTENARIO

1905-2005



My page:

http://www.urielpelado.com.ar

My Gallery:

http://www.celestiaproject.net/gallery/view_al ... y-Universe

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #14by marc » 09.06.2003, 13:39

Damn I wish I still had a win98 system that I could test this on.

Hopefully one of these might help you out.

Are you double clicking on the genearate_all.bat file or running it from the command line? Try running it from the command line.

There is a *.err file in your dbdata directory, it is a text file. Can you post what is in that (just the first page or so if there is a lot)

here is what the error code means.
Error code 145: Unknown error
145 = Table was marked as crashed and should be repaired

try these from the command line and tell me what the output is.

C:\Program Files\Celestia>myisamchk -r .\dbdata\mh\star


C:\Program Files\Celestia>myisamchk -r .\dbdata\mh\starNames

C:\Program Files\Celestia>generate_all.bat

If all else fails unistall, make sure that the dbdata is deleted. and try again.

Lastly is it a clean installation of Celestia?

good luck.

later: and by command line I mean Start->Run->cmd and not star->Run->command
There is a difference in xp, though I cant remember if there is in win98.

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #15by ElPelado » 09.06.2003, 15:20

in the *.err i have only this:

Code: Select all

mysql_embedded: File 'D:\Program Files\Celestia\dbdata\a4r3c9-slow.log' not found (Errcode: 13)
030609 15:09:47  Could not use a4r3c9-slow.log for logging (error 13)
mysql_embedded: File 'D:\Program Files\Celestia\dbdata\a4r3c9-slow.log' not found (Errcode: 13)
030609 15:15:38  Could not use a4r3c9-slow.log for logging (error 13)


with this
C:\Program Files\Celestia>myisamchk -r .\dbdata\mh\star
the output was:

Code: Select all

- recovering (with sort) MyISAM-table '.\dbdata\mh\star'
Data records: 112519
- Fixing index 1
- Fixing index 2
...
- Fixing index 17


with
C:\Program Files\Celestia>myisamchk -r .\dbdata\mh\starNames

Code: Select all

- recovering (with sort) MyISAM-table '.\dbdata\mh\starNames'
Data records: 114177
-fixing index 1


update: i have uninstalled and when installing again, i also recieve error number 13. what is it?(it has also appeared before uninstalling i think)

update2: each time i run the .bat file, the number of stars is lower
---------X---------

EL XENTENARIO

1905-2005



My page:

http://www.urielpelado.com.ar

My Gallery:

http://www.celestiaproject.net/gallery/view_al ... y-Universe

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #16by ElPelado » 09.06.2003, 15:39

I JUST CANT BELIVE IT, I DONT KNOW HOW, I DONT KNOW WHY AND NITHER WHEN, BUT ITS WORKING NOW!!!!!!!!


i have one question, when entering this

Code: Select all

SELECT hip, CONCAT(spectralClass,spectralSubClass,' ',luminosityClass) AS class, bolometricMagnitude FROM star WHERE spectralClass='M' AND distFromSol<30;

(it appears in the tutorial)
at the bottom of the table that i get, is written "too many results to display", can i change this??
---------X---------

EL XENTENARIO

1905-2005



My page:

http://www.urielpelado.com.ar

My Gallery:

http://www.celestiaproject.net/gallery/view_al ... y-Universe

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #17by marc » 10.06.2003, 03:59

ElPelado wrote:I JUST CANT BELIVE IT, I DONT KNOW HOW, I DONT KNOW WHY AND NITHER WHEN, BUT ITS WORKING NOW!!!!!!!!


Thats good to hear, though it would be nice to know how. Do you have the correct number of stars in the star table? ie 112520.
I still think there is something fishy going on.
How much free disk space do you have?

Error code 13 : Permission denied
Error code 3 : No such process

Have you run genearate_all.bat at the same time as running mostlyharmless.exe (Celestia) by any chance?

Can you show me what is in the a4r3c9-slow.log file?

I limited the number of rows that would be displayed to about 30 because if there are too many they just run off the bottom of the screen and time is wasted displaying text that the user cant even see. To view the data you are looking for you can use the ORDER BY and LIMIT keywords.

For example.

Code: Select all

SELECT hip, CONCAT(spectralClass,spectralSubClass,' ',luminosityClass) AS class, bolometricMagnitude FROM star WHERE spectralClass='M' AND distFromSol<30 ORDER BY spectralSubclass;


or

Code: Select all

SELECT hip, CONCAT(spectralClass,spectralSubClass,' ',luminosityClass) AS class, bolometricMagnitude FROM star WHERE spectralClass='M' AND distFromSol<30 ORDER BY bolometricMagnitude DESC LIMIT 10;


Chapter 3 of the mysql manual has a good tutorial if you want to learn more.
http://www.mysql.com/doc/en/Tutorial.html

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #18by ElPelado » 10.06.2003, 11:00

yes i have all teh stars now. first i unistall the program. then install it again. then it didnt work, then i run in the command the fisr two things that you told me to do(...\star and ...\starnames). and then it worked.
i have between 2 and 3 GB of free disk space on that disk, and 4 in the other one.

Have you run genearate_all.bat at the same time as running mostlyharmless.exe (Celestia) by any chance?

no i didn't.

this is what the a4r3c9-slow.log file says:

Code: Select all

mysql_embedded, Version: 4.0.12-embedded-log, started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
mysql_embedded, Version: 4.0.12-embedded-log, started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
mysql_embedded, Version: 4.0.12-embedded-log, started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
mysql_embedded, Version: 4.0.12-embedded-log, started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
mysql_embedded, Version: 4.0.12-embedded-log, started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
mysql_embedded, Version: 4.0.12-embedded-log, started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
---------X---------

EL XENTENARIO

1905-2005



My page:

http://www.urielpelado.com.ar

My Gallery:

http://www.celestiaproject.net/gallery/view_al ... y-Universe

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #19by marc » 10.06.2003, 23:39

ElPelado wrote:yes i have all teh stars now. first i unistall the program. then install it again. then it didnt work, then i run in the command the fisr two things that you told me to do(...\star and ...\starnames). and then it worked.


This might mean that the star and starNames tables have something wrong with them even before the generation process starts. Or they are getting munged at the first generation step. Mabey there is a difference between the way a database is stored on a win98 machine as opposed to an NT machine. To be on the safe side I will add some extra steps at the start that will create the table structure from scratch and do a check/repair on them as well. I will have to make sure that the main generation process is getting all its errors written to the log file as well.

Thanks for spending the time on this ElPelado, much appreciated.

If anyone else using win98 has any trouble please let me know.

ElPelado
Posts: 862
Joined: 07.04.2003
With us: 21 years 7 months
Location: Born in Argentina
Contact:

Post #20by ElPelado » 11.06.2003, 09:07

you are welcome marc.
if you need any other help with this, just tell me.
good look!
---------X---------

EL XENTENARIO

1905-2005



My page:

http://www.urielpelado.com.ar

My Gallery:

http://www.celestiaproject.net/gallery/view_al ... y-Universe


Return to “Add-on development”