我有一个约10mln rpws的表,我正在查询日期约束。有<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/question_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<LinearLayout
android:id="@+id/first_linear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/activity_horizontal_margin">
<ImageView
android:id="@+id/up_vote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/vote"
android:src="@drawable/vote_up" />
<TextView
android:id="@+id/vote_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="12"
android:textSize="16sp" />
<ImageView
android:id="@+id/accepted_answer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/accepted"
android:scaleType="fitXY"
android:src="@drawable/correct" />
</LinearLayout>
<com.ms.square.android.expandabletextview.ExpandableTextView
xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
android:id="@+id/expand_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/first_linear"
expandableTextView:maxCollapsedLines="4"
expandableTextView:animDuration="200">
<TextView
android:id="@+id/expandable_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginTop="5dp"/>
</com.ms.square.android.expandabletextview.ExpandableTextView>
</RelativeLayout>
</android.support.v7.widget.CardView>
类型的列dt
(格式为date
)。我在其上创建了一个索引:YYYY-MM-DD
。我在它上面运行了CREATE INDEX dt_dx ON TABLE table(dt)
:
EXPLAIN ANALYZE
是否意味着 Postgres 在将值与查询参数进行比较之前将列数据投射到Index Scan using dt_idx on entities (cost=0.56..74175.26 rows=218 width=64) (actual time=0.069..0.069 rows=0 loops=1)
Index Cond: ((dt)::text = '2017-07-26'::text)
?