postgres debug

This commit is contained in:
Thomas Rudin 2019-02-15 21:32:09 +01:00
parent a91c500e94
commit 7c49292316

View File

@ -78,7 +78,7 @@ func (this *PostgresAccessor) FindNextInitialBlocks(s settings.Settings, layers
"pos2": tcr.Pos2,
"tile": tc,
}
log.WithFields(fields).Debug("Initial-Query")
log.WithFields(fields).Info("Initial-Query")
minX := int(math.Min(float64(tcr.Pos1.X), float64(tcr.Pos2.X)))
maxX := int(math.Max(float64(tcr.Pos1.X), float64(tcr.Pos2.X)))
@ -87,6 +87,20 @@ func (this *PostgresAccessor) FindNextInitialBlocks(s settings.Settings, layers
minZ := int(math.Min(float64(tcr.Pos1.Z), float64(tcr.Pos2.Z)))
maxZ := int(math.Max(float64(tcr.Pos1.Z), float64(tcr.Pos2.Z)))
//upper left: https://pandorabox.io/map/tiles/0/9/-121/-121
//lower right: https://pandorabox.io/map/tiles/0/9/120/120
// INFO[0007] Initial rendering elapsed=24.749287ms mapblocks=0 progress%=2 tiles=0
//INFO[0007] Initial-Query layerId=0 pos1="&{-1968 -1 1935}" pos2="&{-1953 10 1920}" prefix=postgres-db tile="&{-123 -121 9 0}"
//INFO[0007] Initial rendering elapsed=24.587519ms mapblocks=0 progress%=2 tiles=0
//INFO[0007] Initial-Query layerId=0 pos1="&{-1952 -1 1935}" pos2="&{-1937 10 1920}" prefix=postgres-db tile="&{-122 -121 9 0}"
//INFO[0007] Initial rendering elapsed=24.607329ms mapblocks=0 progress%=2 tiles=0
//INFO[0007] Initial-Query layerId=0 pos1="&{-1936 -1 1935}" pos2="&{-1921 10 1920}" prefix=postgres-db tile="&{-121 -121 9 0}"
//INFO[0007] Initial rendering elapsed=25.090037ms mapblocks=0 progress%=2 tiles=0
//INFO[0007] Initial-Query layerId=0 pos1="&{-1920 -1 1935}" pos2="&{-1905 10 1920}" prefix=postgres-db tile="&{-120 -121 9 0}"
//INFO[0007] Initial rendering elapsed=24.754558ms mapblocks=0 progress%=2 tiles=0
//INFO[0007] Initial-Query layerId=0 pos1="&{-1904 -1 1935}" pos2="&{-1889 10 1920}" prefix=postgres-db tile="&{-119 -121 9 0}"
//INFO[0007] Initial rendering elapsed=24.711348ms mapblocks=0 progress%=2 tiles=0
if lastxblock <= -128 {
//first x entry, check z stride
stridecount := this.intQuery(`
@ -129,7 +143,6 @@ func (this *PostgresAccessor) FindNextInitialBlocks(s settings.Settings, layers
blocks := make([]*db.Block, 0)
var lastmtime int64
for {
for rows.Next() {
var posx, posy, posz int
var data []byte
@ -147,10 +160,6 @@ func (this *PostgresAccessor) FindNextInitialBlocks(s settings.Settings, layers
mb := convertRows(posx, posy, posz, data, mtime)
blocks = append(blocks, mb)
}
if !rows.NextResultSet() {
break
}
}
s.SetInt(SETTING_LAST_LAYER, lastlayer)
s.SetInt(SETTING_LAST_X_BLOCK, lastxblock)