Trying to recreate my SQL Server database on PostgreSQL. Everything is ok except I can't find how to recreate this index:
USE [mytablename]
GO
CREATE NONCLUSTERED INDEX [myindex]
ON [dbo].[mytablename] ([col1],[col2])
INCLUDE ([col3],[col4])
GO
Will be very grateful for help.
Alexey
Update:
http://img38.imageshack.us/img38/1071/89013974.png here is db structure star+eav
there is only one query
SELECT this_.id as id0_0_,
this_.device_id as device2_0_0_,
this_.time_id as time3_0_0_,
this_.gps_detail_id as gps4_0_0_
FROM [scoutserver_data].[dbo].[DataMessage] this_
WHERE this_.time_id = 65536 and this_.device_id = 32768
Maybe it is not optimal atm. And im working on it also. Maybe something like this
SELECT * FROM [scoutserver_data].[dbo].[TimeDimension]
INNER JOIN ([scoutserver_data].[dbo].[DeviceDimension]
INNER JOIN [scoutserver_data].[dbo].[DataMessage]
ON [DeviceDimension].[device_id] =[DataMessage].[device_id])
ON [TimeDimension].[time_id] = [DataMessage].[time_id]
WHERE DeviceDimension.serial_id='2' AND TimeDimension.Day=15 AND TimeDimension.Year=2009
Any hints welcome =)