Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

See this reference Using Postgres for Spatial Data.

basic statement

select * id, time, energy from events where ra_min < ra and ra < ra_max and dec_min < dec and dec < dec_max
The response time is around 1. second. On 100 queries the average number of events found is 50.

statement with geo functions

select * id, time, energy from events where point(ra,dec) @ box ra_max,dec_max, ra_min,dec_min
The object point is constructed with the content of the 2 columns ra, dec. The operator @ means is inside.
The response time is around 1.2 second.

select * id, time, energy from events where position @ box ra_max,dec_max, ra_min,dec_min
A column position has been added to the table. It is of type point and stores ra, dec.
The response time is around 0.7 second.

select * id, time, energy from events where error && box ra_max,dec_max, ra_min,dec_min
A column error has been added to the table. It is of type box and stores ra+dg, dec+dg, ra-dg, dec dg with dg = 1.°. The operator && means overlaps.
The response time is around 0.9 second.

...

PostGIS adds support for geographic objects to PostgreSQL. It implements some of the OpenGIS specifications.
The events table has been modified to comply with the OpenGIS standard. The following statement has been sent to the database :
select * id, time, energy from events where error &&
GeomFromText('POLYGON((ra_max dec_max, ra_max dec_min, ra_min dec_min, ra_min dec_max, ra_max dec_max)', -1)

...

The most recent versions of Mysql provide geospatial functionnalities. These extensions follow the OpenGIS specifications.

basic statement

select * from id, time, energy rom events where ra_min < ra and ra < ra_max and dec_min < dec and dec < dec_max
The response time is around 0.35 second.

...

The following statement has been sent to the database :
select * id, time, energy from events where MBRIntersects(error ,
GeomFromText('POLYGON((ra_max dec_max, ra_max dec_min, ra_min dec_min, ra_min dec_max, ra_max dec_max)', -1))

...